- Issue created by @spokje
- π³π±Netherlands spokje
Well, that escalated quickly....
https://git.drupalcode.org/issue/drupal-3467293/-/pipelines/249780
Not quite sure why the "Updated deps" did pick up on the one failing kernel test and not and the gazillion others, but here we are.
Also not sure why tests are failing, red crosses are showing, but the overall test-report shows
0 failures 0 errors 100% success rate
...
Looks like all/the majority of failures are:
Since twig/twig 3.11: Changing the value of a "filter" node in a NodeVisitor class is not supported anymore.
Well, I suppose we shouldn't do that anymore then...
Anyway, what started as a quick fix as a nice start of my day turned into something a bit more involved.
Going to fill up on caffeine before looking at this. - π³π±Netherlands spokje
So our problem comes from https://github.com/twigphp/Twig/commit/e8141bbd348582e44715a98201d7f6b86...
and seems to be that we swap out theescape
for our owndrupal_escape
filter here: https://git.drupalcode.org/project/drupal/blob/973b6ec18b9649af4deb81e72... - Issue was unassigned.
- Status changed to Needs work
4 months ago 8:54am 10 August 2024 - π³π±Netherlands spokje
Yep, this is above my head.
I would guess we need to do something with the
EscaperRuntime
class.https://github.com/twigphp/Twig/issues/4102#issue-2323595412
- π³π±Netherlands spokje
So all of the test failures seem to be deprecation warnings:
1) D:\htdocs\drupal\vendor\symfony\deprecation-contracts\function.php:25 Since twig/twig 3.11: Changing the value of a "filter" node in a NodeVisitor class is not supported anymore.
To prevent out 'Updated deps' run to fail and hide problems with other updates, let's try suppressing that deprecation error and open a follow-up to deal with it properly.
- π³π±Netherlands spokje
Opened follow-up π [PP-1] twig/twig 3.11.0 introduces (for Drupal) breaking changes Postponed to fix the deprecation and remove the suppression.
- Status changed to Needs review
4 months ago 6:03am 14 August 2024 - Status changed to RTBC
4 months ago 2:57pm 14 August 2024 - πΊπΈUnited States smustgrave
Nice catch!
Tests are green so don't see any issue there or when applied locally with using 3.11
Believe this is fine.
- Status changed to Needs review
4 months ago 11:53am 15 August 2024 - π¬π§United Kingdom longwave UK
Aren't we losing some test coverage by deleting those lines? It looks minimal but I assume it was added for a reason, if we can work around the issue instead of deleting the code then we probably should.
- π³π±Netherlands spokje
Aren't we losing some test coverage by deleting those lines?
From the comment above the to-be-deleted test-case:
Manually change $templateClassPrefix to force a different template classname, [snipped]
There is no more
$templateClassPrefix
intwig/twig 3.11.0
and AFAICT there's no way to change the template classname anymore, since it's now hard-coded to `'__TwigTemplate_'`. (https://github.com/twigphp/Twig/commit/215f9880f1bbd10cf01317c4cb1b40a4e...)So IMHO we're deleting a test for a situation that isn't possible anymore (changing the template class prefix).
Also\Twig\Environment::$templateClassPrefix
was alreadyprivate
(at least in 3.10), so it seemed to be frowned upon to change it to begin with.Happy to be convinced otherwise :)
- Status changed to RTBC
4 months ago 12:07pm 15 August 2024 - π³π±Netherlands spokje
For reference, this test was added in #2752961: No reliable method exists for clearing the Twig cache β
- π¬π§United Kingdom catch
Test coverage removal explanation makes sense to me.
Committed/pushed to 11.x - I think we probably want to backport this to 10.4 too, so moving for backport there.
- Status changed to Downport
4 months ago 11:44pm 16 August 2024 - Status changed to Needs review
4 months ago 7:15am 17 August 2024 - Status changed to Fixed
4 months ago 10:55am 17 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.