Problem/Motivation
Theme debugging is slightly more cumbersome to enable for beginners than it used to be, there are three variables that need to be added to the services.yml file, without accidentally committing the changes and pushing them to production.
Drupal core ships with both a development.services.yml file for the purpose of enabling some development-mode settings for local development work, and a example.settings.local.php file (that can be cloned and renamed to "settings.local.php") to load that. However, even making those steps is not enough, the site builder must then still customize the development.services.yml file itself to add the n
Proposed resolution
Add the necessary settings in development.services.yml to enable theme debugging when that file is loaded.
Remaining tasks
TBD
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | drupal-n3272587-13.patch | 1.25 KB | damienmckenna |
Comments
Comment #2
damienmckennaThis modifies the development.services.yml file as suggested.
Comment #3
damienmckennaThis includes one patch for the core/assets/scaffold/files/development.services.yml file and another that covers both.
Comment #6
damienmckennaComment #7
damienmckenna:facepalm:
It goes in the "parameters" section, not the "services" section.
Comment #10
andregp commentedI believe it's needs review as per drupal-n3272587-7.patch at #7
Comment #11
damienmckennaUnfortunately this doesn't actually work, having these lines in development.services.yml doesn't override what's defined in services.yml, which seems like a core bug.
Comment #12
jwilson3Title says: "Enable theme debugging by default in development.services.yml".
Then shouldn't parameters.twig.config.debug be set to true instead of false? (Maybe this is why you thought you were seeing a bug where settings do not override those in services.yml (fwiw, ive never had a problem overriding services.yml).
My understanding of auto_reload is that it generally should always be left as null, because it knows what to do based on whatever value is set for the debug value.
see note at end of comment #2839709-25: Make Debugging Twig easier
Why this is a better approach than the one on #2839709: Make Debugging Twig easier. Do you have any thoughts?
Comment #13
damienmckenna*cleans his glasses*. This one turns on the "debug" mode. Thanks James.
I didn't know about #2839709 before I put this one together. My rationale for modifying this file was the simplicity of leveraging what's included in the codebase already rather than making the codebase more complicated by adding another file; the development.services.yml file is already intended to be used locally when the site is in development mode, which is when you'd want the theme debugging enabled.
Comment #14
jwilson3Rationale makes sense, however, not all developers want theme debugging turned on by default, and my experience is that it can occasionally break site functionality, but it's an edge case, and adds some level of additional page generation overhead (how much, I'm not entirely sure).
Comment #16
damienmckennaAfter thinking on it a bit, I'm going to close this and go with #2839709 as an extra opt-in option for sites to manage.