Problem/Motivation
It seems module based implementations of hook_theme_registry_alter are always overriden in the sense that Omega hooks are taking precedence. This might be a problem with my configuration but all of my module implementations of hook_theme_registry_alter worked in AdaptiveTheme before I ported everything to Omega so am still looking for some rationale on what I am doing wrong.
Say for instance I have a module called wetkit_breadcrumbs with the following code defined:
function wetkit_breadcrumbs_theme_registry_alter(&$theme_registry) {
$theme_registry['breadcrumb']['theme path'] = drupal_get_path('module', 'wetkit_breadcrumbs');
$theme_registry['breadcrumb']['file'] = drupal_get_path('module', 'wetkit_breadcrumbs') . '/theme/wetkit_breadcrumbs.theme.inc';
$theme_registry['breadcrumb']['function'] = 'wetkit_breadcrumbs_breadcrumb';
}
Then setting a breakpoint near the beginning and end of the code in omega_theme_registry_alter I can see the following:
Beginning of function:
['registry']['breadcrumb']['file'] = "profiles/wetkit/modules/custom/wetkit_breadcrumbs.theme.inc
['registry']['breadcrumb']['function'] = "wetkit_breadcrumbs_breadcrumb"
['registry']['breadcrumb']['theme path'] = "profiles/wetkit/modules/custom/wetkit_breadcrumbs"
End of function:
['registry']['breadcrumb']['file'] = "profiles/wetkit/modules/custom/wetkit_breadcrumbs.theme.inc
['registry']['breadcrumb']['function'] = "omega_breadcrumb"
['registry']['breadcrumb']['theme path'] = "profiles/wetkit/modules/custom/wetkit_breadcrumbs"
Is there a way for my module to override the Omega theme settings so that the function remains the same as specified inside my module?
Related Issues
https://drupal.org/node/2058597 (Template Inheritance)
Comment | File | Size | Author |
---|---|---|---|
#4 | 2059213-4.patch | 565 bytes | fubhy |
#3 | 2059213-2.patch | 565 bytes | fubhy |
Comments
Comment #1
fubhy CreditAttribution: fubhy commentedThe template inheritance issue is not related to this one. It's a core bug.
Anyways, I will think about this some more today. A potential solution would be to add a optional flag to theme registry entries e.g. "final => TRUE" so that Omega considers it as fully processed already and won't touch it at all.
Comment #2
fubhy CreditAttribution: fubhy commentedPlease check if this patch works for you...
It should allow you to do this:
Comment #3
fubhy CreditAttribution: fubhy commentedForgot to upload the patch.
Comment #4
fubhy CreditAttribution: fubhy commentedSorry, incorrect... This is better.
Comment #5
sylus CreditAttribution: sylus commentedHey @fubhy that patch does indeed correct all of my problems. I really appreciate you taking the time and love the work that is going into Omega 4.x.
I did notice that there is another way module maintainers implement hook_registry_theme_alter but it only modifies the path. Am I correct no fix will be needed for the following to work in Omega? I currently have no problems leveraging this type of hook so guessing it is okay but wanted to clarify.
Comment #6
sylus CreditAttribution: sylus commentedSetting to RTBC
Comment #7
fubhy CreditAttribution: fubhy commentedThanks.
I am not 100% sure what that code snippet does so don't know what I should answer :P.