Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following notice is generated when I use a theme.inc file named:
menu-link--menu-category-menu.theme.inc
Notice: Undefined index: theme path in theme() (line 1058 of xxx/includes/theme.inc).
The code runs smooth in template.php, but when using the nice feature to split the code in seperate inc files it goes wrong.
Maybe something to do with the double - ?
The function is named: menu_link__menu_category_menu(). So I think it logic to replace the __ with -- in the filename.
Comment | File | Size | Author |
---|---|---|---|
#4 | omega.code_.2081423-4.patch | 15.33 KB | fubhy |
#3 | omega.code_.2081423-3.patch | 8.41 KB | fubhy |
Comments
Comment #1
fubhy CreditAttribution: fubhy commentedYep, verified.. There is a bug with the theme function override discovery. It works in 99% of the cases but if you have an entry that previously didn't have 'theme path' (which is valid in some cases) it will fail. Fix incoming.
Comment #2
fubhy CreditAttribution: fubhy commentedSame problem as in #2078365: path_to_theme() shows omega base theme's path. Closed the other issue as duplicate.
Comment #3
fubhy CreditAttribution: fubhy commentedI think it's time to finally clean up omega_theme_registry_alter() while we are at this... This patch should fix your problems. Please give it a test-spin.
Comment #4
fubhy CreditAttribution: fubhy commentedOh, sorry.. I forgot to include the new file in the diff... This is the right patch. Ignore my last comment.
Comment #5
fubhy CreditAttribution: fubhy commentedI just tested this for about 30 minutes straight. It's much cleaner than what we had previously (cluttering template.php much less) and it works and writes the 'theme path' property (as well as the 'type' property which was not written properly in some cases either) correctly now.
Commited http://drupalcode.org/project/omega.git/commit/557eef2
Comment #7
dddbbb CreditAttribution: dddbbb commentedSorry to re-open this but I'm still seeing path_to_theme() return the omega base theme path rather than the currently enabled sub theme path when using a preprocess file. The same code from within template.php works just fine.
Tested 7.x-4.0 which, as I understand it, was released after the commit that is mentioned in #5.
Comment #8
steinmb CreditAttribution: steinmb as a volunteer commented@danbohea thank you for the report. Do you still see it in 7.x-4.x-dev. If so, how do we re-produce this?
Comment #9
axelpezzo CreditAttribution: axelpezzo commentedHi to all,
I've an similar issue. I've a Drupal 7.42 installation with a Omega 4.4 sub-theme, sometimes (when the Cron run I think), the filed_theme() not works.
This because ThemeRegistry indicate the subtheme path and not the omega path.
I check and this patch already exists in the Omega 4.4 so... what's the problem?
Now, I import the omega file theme/field.inc in my subtheme. In this way i've the correct path in each case (theme_path: Omega or SubTheme).
Comment #10
axelpezzo CreditAttribution: axelpezzo commented