Open mlncn opened 4 months ago
I am also seeing this. These Drush commands used to allow enabling and disabling Twig debugging, but now do nothing:
It can also be activated/deactivated with Drush:
drush state:set twig_debug 1 --input-format=integer && \ drush state:set twig_cache_disable 1 --input-format=integer && \ drush state:set disable_rendered_output_cache_bins 1 --input-format=integer && \ drush cache:rebuild
To disable debug mode in Drupal 10:
drush state:set twig_debug 0 --input-format=integer && \ drush state:set twig_cache_disable 0 --input-format=integer && \ drush state:set disable_rendered_output_cache_bins 0 --input-format=integer && \ drush cache:rebuild
From Disabling and debugging caching > Enabling Twig debugging via Drush.
I need to activate it via GUI at /admin/config/development/settings.
Q | A |
---|---|
Drush version | 12.5.2.0 |
Drupal version | 10.3.1 |
PHP version | 8.2.20 |
OS | Debian 12 with DDEV 1.23.3 |
Same issue as gitressa, mlncn. The Drush commands to enable / disable twig debug are not working, either when using:
drush state:set twig_debug 0 --input-format=integer && \
drush state:set twig_cache_disable 0 --input-format=integer && \
drush state:set disable_rendered_output_cache_bins 0 --input-format=integer && \
drush cache:rebuild
or
drush twig:debug off
Disabling / enabling via the UI does work (/admin/config/development/settings).
System Configuration | Q | A |
---|---|---|
Drush version | 12.5.3.0 | |
Drupal version | 10.3.3 | |
PHP version | 8.3.11 |
This commands no longer works for Drupal v10.3 and above. In version 10.3, the storage for these settings was changed from state to keyValue.
see https://www.drupal.org/project/drupal/issues/3437162 and https://www.drupal.org/node/3438802
You can set it with eval in v10.3 above, see https://drupal.stackexchange.com/a/316894/72678
Thanks for clearing this up @hudri, I guess these files needs a PR then (maybe more?) for drush twig:debug on
to work again:
I updated the documentation at https://www.drupal.org/docs/develop/development-tools/disabling-and-debugging-caching. Thanks again @hudri!
Describe the bug
Twig debug output should start showing when Drush's twig:debug command is run.
To Reproduce What did you do?
Ran
drush twig:debug on
and twig debug output did not come on.Tried turning it on and off, removing and adding services.yml files, and pretty much everything to no avail— except looking in Drupal's UI, where turning twig debugging on at
/admin/config/development/settings
worked fine.Expected behavior
Pretty much no matter what other settings are in place, running
drush twig:debug on
should begin showing twig template information in HTML comments— or at least indicate an error of why it cannot.Actual behavior
Nothing but a message " [OK] Enabled twig debug. " which was not actually true.
Workaround
Go to
/admin/config/development/settings
and enable "Twig development mode" and inside that "Twig debug mode" and "Disable Twig cache".Twig debugging / caching settings added to administrative user interface | Drupal.org
System Configuration
Additional information
This site installs from config, in case that could be a factor somehow.