Description of the need
I'm developing a site, both functionally and with appearance that makes some of its data available as a CSV using views_data_export
. I often have theme_debug
switched on which then breaks the CSV. This is less an issue for production but it can be a pain in development if the service using the CSV then breaks.
Proposed solution
(A) An optional boolean override for the theme
function in core/includes/theme.inc
that is then checked here:
https://github.com/backdrop/backdrop/blob/6e7b4cc0fabf6040def143c38b88b4...
(B) A documented way for developers to list all templates or calling modules that should be excluded from theme_debug. The theme.inc will then test that in addition to checking the theme_debug
setting
Alternatives that have been considered
Describe alternatives you've considered. Have you seen this work in a better way in another CMS?
I created a small hack of theme.inc
to test if this principle could work
if ($theme_debug && strpos($info['template'],'views-data-export')>0) {
$output = _theme_render_template_debug($render_function, $template_file, $variables, $extension);
}
This worked but hacking core files is not going to be a sustainable solution and I can't see that this is possible to override in a hook.
The alternative is to switch theme_debug on and off all the time either using Devel or settings.php
/settings.local.php
Possibly modules could switch the setting off and on again but that may cause other issues
Is there a Drupal or Backdrop contributed module that accomplishes this? ...if so, then please provide a link.
Additional information
Add any other information or screenshots that would help.
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes the ability for developers to disable theme_debug for particular modules or templates, for example, if using Views Data Export.
Recent comments
https://www.drupal.org/project/views/issues/1266388 shows that this is an architectural issue, and requires another 2 hooks being adjusted. It would be really nice to add comments/notes to...
node access
Hmmm, from D7 ancient tomes: from https://drupal.stackexchange.com/questions/7056/limit-which-roles-can-view-a-node-basing-on-its-content-type yet https://docs.backdropcms.org/api/...
node access
I also note on this screen: "Furthermore note that content which is not published is treated in a different way by Backdrop: it can be viewed only by its author or users with the...
node access