Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297938

Front end theme does not participate in drupal_alter() hooks.

$
0
0

Problems/Motivations

Currently a hook_library_alter() defined in the template.php of a front-end theme is not called.

When you empty the cache so it build the theme registry, the hook_library_alter() is never called.

This is however super important when you detach completely the front-end theme from drupal and wants to redefines some jquery library versions / Or adds a new UI.

Some people on the internet claims it is possible to implements alter_hook in template.php but I could not manage to reproduces it.

The only work around right now is to externalize a module which define the alter hook, but then for my use case it replace the jquery, and jquery.ui for the whole drupal system, thus the admin theme as well.

It then break the admin theme and contributed modules when contributing on the back-end which is not the expected behavior.

Proposed resolution

Theme should be able to alter hooks on a per-theme basis.

A possible solution is having a hook registry per active theme.

I read these already

#812016: Themes cannot always participate in drupal_alter()
#591794: Allow themes to alter forms and page


Viewing all articles
Browse latest Browse all 297938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>