General summary
- This is not considered a beta blocker or critical issue for D8.
- While patches exist in this thread for D7 (and may work for you), official fix will be to D8 first -- please do not switch issue metadata until we are ready to start the D7 backport.
Problem/Motivation
When you have a template suggestion available and are using that template, preprocess functions following naming conventions provided via hook_theme_suggestions_HOOK() are not being recognized, for example:
MYTHEME_preprocess_node__article()
MYTHEME_preprocess_block__search_form_block()
MYMODULE_preprocess_page__front()
MYMODULE_item_list__search_results()
etc.
Proposed resolution
Add a post-process step to the theme registry build to look for these types of preprocess functions and add them to the theme registry.
Remaining tasks
Patch needs review.
User interface changes
N/A
API changes
Removes the global drupal_group_functions_by_prefix() (moves it to a class to make things testable) which was added May 13, 2015: #2339447: Improve theme registry build performance by 85%
Beta phase evaluation
Issue category | Bug, there was similar functionality to this in Drupal 6, or at least in Views |
---|---|
Issue priority | Major because it represents a big improvement to themer/developer experience. |
Disruption | Little to no disruption, just an addition that core and contrib can choose to use or not use. |
Related Issues
- #2229355: Field template suggestions are colliding
- #2307103: Follow-up: remove explicit comment field theme hook suggestion implementation via #1962846: Use field instance name for header of comment list, drop comment-wrapper template
- #2231853: Rename maintenance-page template into page--maintenance + install-page into page--maintenance--install is working around this issue
- this issue is blocking #1885714: Remove theme_install_page()
- also appears to be blocking #2231853: Rename maintenance-page template into page--maintenance + install-page into page--maintenance--install?