Theme function files do not seem to be getting loaded for theme hook suggestions. E.G. field--field-name.theme.inc.
OmegaThemeRegistryHandler::registerThemeFunctions() is properly detecting the file and adding it to the registry under the suggestions own array. However it seems the includes will never be called because Drupal's theme() function only includes files for the base theme.
I don't have time to make a proper patch at the moment but the fix is a simple one in OmegaThemeRegistryHandler::registerThemeFunctions() change:
// By adding this file to the 'includes' array we make sure that it is
// available when the hook is executed.
$this->registry[$item->hook]['includes'][] = $item->uri;
to
// By adding this file to the 'includes' array we make sure that it is
// available when the hook is executed.
$this->registry[$base]['includes'][] = $item->uri;
Seems odd that this has gone unnoticed and I wondered why I never ran into this before but I realised whenever I have used non-base theme functions they have tended to be small and thus I lazily put them in my template.php file. Others may be as slack as me :P
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | function_include_files-2292961-8.patch | 486 bytes | sylus |
| #2 | omega-include_theme_hook_suggestion_files-2292961-2.patch | 486 bytes | drupal_was_my_past |
Comments
Comment #1
drupal_was_my_past commentedClosed #2307897: Theme function override not working as a duplicate of this issue.
Comment #2
drupal_was_my_past commentedGood catch @magicmyth. I spent a really long time puzzling over this and when I finally figured it out, I discovered you had already beat me to it. Here is a patch.
Comment #4
fubhy commentedThanks! Fixed.
Comment #6
sylus commentedPlease close if improper to reopen this issue but this recent commit caused menu that I was invoking to not appear when logged out but strangely work when logged in.
Reverting this commit caused my menus to function properly again when logged out.
I invoked one of my menus by the following:
Is there something I am missing?
Comment #7
sylus commentedI put a dpm before this commit above:
dpm($item->hook);
....
links
links
links
pager_first
pager_last
pager_next
pager_previous
pager
panels_ipe_placeholder_pane
dpm($item->hook);
links__menu_menu_wet_footer
links__menu_menu_wet_header
links__menu_menu_wet_terms
pager_first
pager_last
pager_next
pager_previous
pager
panels_ipe_placeholder_pane
So using $base we don't get the full form for links?
Comment #8
sylus commentedAttaching patch to revert this commit so I can patch on latest stable 4.3
Comment #9
joelpittetComment #10
nightlife2008 commentedHey guys,
I was experiencing the exact same issue, with the following steps to reproduce:
1. Go to your subtheme settings page in Drupal admin.
2. Change nothing, just press "Save".
3. Frontend is broken, showing empty divs, missing preprocessors etc.
4. Flush theme registry cache
5. Frontend is fixed, showing proper classed divs, running necessary preprocessors etc.
I was able to fix the issue, by currently disabling the Mailsystem module, so I presume the bug occurs in that module rather than the Omega registry.