- Issue created by @idiaz.roncero
- 🇪🇸Spain idiaz.roncero Madrid
I can't tell why, but the simple injection of the Twig service (TwigEnvironment) seems to be the enough to cause the problem.
It is not tied to any particular use of that service. You can delete all uses of $twig inside the decorated service and it will fail the same.
To reproduce, just delete the Twig injected service:
critical_css/critical_css.services.yml
services: asset.css.collection_renderer.critical_css: public: false class: Drupal\critical_css\Asset\CssCollectionRenderer decorates: asset.css.collection_renderer arguments: - '@asset.css.collection_renderer.critical_css.inner' - '@config.factory' - '@twig' <-----------------REMOVE THIS - '@critical_css'
...and also from
critical_css/src/Asset/CssCollectionRenderer.php
.Then, it will work as usual.
- 🇪🇸Spain idiaz.roncero Madrid
WORKAROUND! This is NOT a fix for the issue
WORKAROUND! This is NOT a fix for the issue
WORKAROUND! This is NOT a fix for the issueThe attached patch removes the twig injected service (and, of course, the debug functionality of the module).
This will make the bug disappear but can't be considered a solution to the issue, just a workaround.
- Assigned to albertosilva
- 🇪🇸Spain albertosilva Basque Country
Hi,
I cannot reproduce this issue, could you please try it again and provide more details?
Thanks
Dealing with the same issue here, the work around of idiaz.roncero works, but waiting for a better solution here :)
- Status changed to Closed: works as designed
10 months ago 1:55pm 1 March 2024 - 🇧🇪Belgium dieterholvoet Brussels
This problem is caused by 🐛 Enabling SDC causes the frontend theme to be used in admin routes Needs work and can be fixed by patching Drupal core with the MR from that issue. This issue only occurs when the SDC module is installed, that's why not everyone seems to be able to reproduce it.