I'm making a subtheme node--type.tpl.php and and using $theme_path- which is returning the incorrect path of sites/all/themes/zen.

When looking over the $theme_path code in modules/php/php.module it looks like drupal is using a simple drupal_get_path function..

Some notes:
$theme returns my subtheme correctly
zen is not enabled, but this behavior is persistant when it is.
I did clear caches, even used registry_rebuild.
This tpl file is inside sites/default/subtheme/templates/

So I'm reporting this... wondering if this is a bug?

Comments

johnalbin’s picture

Version: 7.x-5.1 » 7.x-5.x-dev
Status: Active » Fixed

Yes, that is definitely a bug. Unfortunately, it is unfixable in D7.

The theme() function temporarily changes $theme_path to the theme that controls the template file. So inside each template file, the $theme_path means "path to this template file". Everywhere else, the $theme_path is the path to the active theme. :-p

Status: Fixed » Closed (fixed)

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