- Issue created by @Jons
- 🇺🇸United States will_frank
Hoping these comments might help further pin down the problem.
Using the upgrade_status via the UI and running scans
we see the most of these errors for themes, like
Seven 1214 problems
Bootstrap Barrio 1907 problems.
Might the problem have to do with twig code static analysis in particular.We have updated Drupal Core to 10.3.5 and we noted this following in the
10.3.4 release notes:
The Twig templating library has issued a security advisory. Drupal core is not vulnerable, but previous versions of the drupal/core-recommended package only allowed insecure versions of Twig to be installed. This patch release upgrades Twig to 3.14.0 as a public security hardening. - 🇿🇦South Africa foxtrotcharlie
I've also come across this recently when resolving deprecations in custom modules after updating Drupal to 10.3.5. This one in particular was causing over 1800 deprecation warnings in a custom theme:
Since twig/twig 3.12: Getting node "filter" on a "Twig\Node\Expression\FilterExpression" class is deprecated.
My understanding is that this is a bug in Drupal Core, not the custom module, due to the way that core takes over escaping of variables printed in Twig templates, so every variable that is printed is auto escaped, and uses Drupal's custom `drupal_escape` instead of Twig's `escape` filter, which hasn't been updated to resolve the deprecation. This causes every printed variable to trigger this error!
Ideally, one would want upgrade_status to be able to determine whether an error is actually coming from the custom module vs Drupal Core.
- 🇭🇺Hungary Gábor Hojtsy Hungary
gábor hojtsy → made their first commit to this issue’s fork.
- Status changed to Needs review
about 2 months ago 5:56am 21 September 2024 - 🇭🇺Hungary Gábor Hojtsy Hungary
We also noticed 190k or so of these errors with twig 3.12 across scanning all of contrib with Deprecation Status. Since the error (almost?) always come from core not being compatible, we should not burden users with trying to figure this out. I proposed an MR here that puts the error in the "ignore" category. It is not required to resolve twig 3.12 incompatibilities anyway to be compatible with Drupal 11 :)
- Status changed to Needs work
about 2 months ago 6:03am 21 September 2024 - 🇭🇺Hungary Gábor Hojtsy Hungary
Uh the tests are also getting caught up with the twig problems, they need to be updated to expect them in an "ignore" category.
- First commit to issue fork.
- 🇭🇺Hungary Gábor Hojtsy Hungary
The referenced core issue and above that 📌 Fix Twig 3 deprecations Needs review is where we are actually fixing the core issues that cause this, so Upgrade Status should not fix this for now. The plan is a bugfix release of core soon will fix this. Postponing on that for now.
- 🇭🇺Hungary Gábor Hojtsy Hungary
I believe 📌 Twig Filter "spaceless" is deprecated Active is still outstanding but otherwise this is resolved in core and fixes were released in patch versions of core.
- 🇭🇺Hungary Gábor Hojtsy Hungary
The tests pass fine on the simple ignore fix now I think given the core fixes. We can merge that in to stop the bleeding on older core versions too without changes needed to the tests.
-
gábor hojtsy →
committed 7f8ff7c8 on 4.x
Issue #3474572 by bbrala, gábor hojtsy, jons, foxtrotcharlie, will_frank...
-
gábor hojtsy →
committed 7f8ff7c8 on 4.x
Automatically closed - issue fixed for 2 weeks with no activity.