Since updating from 3.0 to 3.4, any path_to_theme() or $directory prints the path of bootstrap rather then the subtheme.

I've temporary fixed it by adding this to my functions file:

function THEME_preprocess_page(&$vars) {
$vars['theme_path'] = $vars['base_path'] . $vars['directory'];
}

and manually going through each .tpl file and replacing path_to_theme() with $theme_path.

Is this a bug with the bootstrap update or am I going to have to update all future sites this way?

Thanks

Comments

danthorne created an issue. See original summary.

markhalliwell’s picture

This is technically a bug with path_to_theme() in core itself. You should never use that function. For a proper solution, use:

$theme_path = drupal_get_path('theme', 'my_subtheme');

Or:

$theme_path = drupal_get_path('theme', $GLOBALS['theme']);

However, I wouldn't use this as you might have the same issue like path_to_theme() does.

See https://api.drupal.org/api/drupal/includes%21theme.inc/function/path_to_...