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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fubhy’s picture

Yep, 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.

fubhy’s picture

Same problem as in #2078365: path_to_theme() shows omega base theme's path. Closed the other issue as duplicate.

fubhy’s picture

Status: Active » Needs review
FileSize
8.41 KB

I 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.

fubhy’s picture

FileSize
15.33 KB

Oh, sorry.. I forgot to include the new file in the diff... This is the right patch. Ignore my last comment.

fubhy’s picture

Title: Theme include naming pattern problem » Incorrect 'theme path' definition in theme-registry overrides.
Status: Needs review » Fixed

I 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dddbbb’s picture

Status: Closed (fixed) » Needs work

Sorry 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.

steinmb’s picture

Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)

@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?

axelpezzo’s picture

Hi 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).

axelpezzo’s picture

Status: Postponed (maintainer needs more info) » Active