- Issue created by @douggreen
- last update
11 months ago Custom Commands Failed - last update
11 months ago 25,727 pass, 1,781 fail - last update
10 months ago Build Successful - last update
10 months ago 25,722 pass, 1,829 fail - Status changed to Needs review
10 months ago 5:30am 11 January 2024 - Status changed to Needs work
10 months ago 3:10pm 11 January 2024 - 🇺🇸United States smustgrave
If going to use patches an interdiff should be provided to show what you changed but one was not or an explanation.
Issue summary is missing proposed solution
Will need test coverage
- 🇫🇷France eliechoufani Marseille, Beirut
Hello, I had the error
[error] 8924#8924: *155212268 FastCGI sent in stderr: "PHP message: Uncaught PHP Exception Twig\Error\RuntimeError: "The "Drupal\Core\Template\TwigExtension" extension is not enabled." at /home/XXXXX/www/web/themes/contrib/stable/templates/field/time.html.twig line 22"
after I upgraded Drupal to 10.2.1
And I fixed it with the attached patch, maybe it needs more testing.
I am using
"drupal/twig_extender": "5.1.0",
"drupal/twig_extender_extras": "5.1.0",in my project.
Good luck.
- 🇵🇱Poland lamp5 Rzeszow
I can confirm. The issue exists after update to Drupal 10.2.2 and when using "drupal/twig_extender": "5.1.0",
- 🇺🇸United States bdanin
Confirmed, the patch in comment #6 fixes this issue for me. I am also running twig_extender → .
- 🇺🇸United States neclimdul Houston, TX
Replacing a extension sounds pretty dangerous.
The current approach of calling \Drupal::service is functional but seems like a _huge_ performance hit going to the container ever template render.
Does anyone know why the deprecation compiler code was written into the extension? It seems like it might have just been convenient.
If it was important, maybe we can move it to a dedicated "extension" that's not really an extension that just provides this helper?
If the approach isn't important, maybe we can just inline the check. Something like this maybe:
$compiler->write("isset(\$context['deprecations']) && array_map("); $compiler->indent(); $compiler->write("fn (\$name) =>"); $compiler->indent(); $compiler->write( "isset(\$context['deprecations'][\$name])", "&& \array_key_exists(\$name, \$context)", "&& @trigger_error(\$context['deprecations'][\$name], E_USER_DEPRECATED)," ); $compiler->outdent(); $compiler->subcompile($usedNamesNode); $compiler->outdent(); $compiler->raw(");");
- last update
7 months ago Patch Failed to Apply - 🇮🇳India santhosh@21
This issue exists after drupal upgrade to 10.3.1 from 10.2.7
Patch 6 works for me - 🇵🇭Philippines mjgruta
We upgraded from Drupal 10.1 to 10.2.7 and had a WSOD
Twig\Error\RuntimeError: The "Drupal\Core\Template\TwigExtension" extension is not enabled. in Twig\ExtensionSet->getExtension() (line 35 of docroot/core/themes/claro/templates/admin/admin-block-content.html.twig).
We also had an old version of twig_extender.
Applying the patch #6 and using twig_extender 5.1.0 works fine.
- First commit to issue fork.
- Merge request !9435New twig variable deprecation check should use a service and not the direct class → (Open) created by arunkumark
- Status changed to Needs review
2 months ago 12:00pm 6 September 2024 - 🇮🇳India arunkumark Coimbatore
I created an MR with the #6 patch. I ran the PHPUnit test locally. It is working fine. I have attached a screenshot for your
@smustgrave hope issue summary is fine
- Status changed to Needs work
2 months ago 12:42pm 6 September 2024 - 🇺🇸United States scampbell1 New York
I just tried upgrading to 10.3.6 and am now getting a WSOD. After some googling, I came across this thread (please let me know if it's best if I create a separate issue).
Currently, the error says
Twig\Error\RuntimeError: The "Drupal\Core\Template\TwigExtension" extension is not enabled in "core/themes/claro/templates/classy/layout/html.html.twig". in /code/vendor/twig/twig/src/ExtensionSet.php on line 80
However, #6 would not apply for me because my TwigNodeCheckDeprecations.php already written that way.
I, too, am running Twig Extender.
The issue is that the extension is called by class name statically, For the twig_extender module users the extension called is different than the core one, So this patch get the class name from the service itself.
- Merge request !9765Issue #3409549: New twig variable deprecation check should use a service and not the direct class → (Open) created by alshami
- 🇺🇸United States scampbell1 New York
I haven't done heavy testing (but am no longer getting a WSOD!) but I used the second part of what alshami wrote in their patch to create one for 10.3.6.
There are two versions of the patch: one for the first patch alshami wrote and another for the second. This is the first.
The patch in comment #21 fixes this issue for me after upgrading from 10.3.5 to 10.3.6. I replaced patch at comment #6 with the new patch 3409549-21.patch
I am also running twig_extender.- 🇺🇸United States bdanin