Hi everyone, my theme name is tinman which I've grown into a base theme for my site and a sub-theme to render the Drupal administration pages. So I have:

/themes/tinman/template.php and
/themes/tinmanadmin/template.php

A problem has crept in since I added a multi-site install with the intention of running a test Drupal install. All things being equal, the only change I made was to create a new theme only available to my test installation by adding:

/sites/test.tinman.com/themes/tinmantest

This new theme would allow me to test substantial changes without affecting the production site. I've also assigned /themes/tinmanadmin to be the administration theme for the test site. All of the themes work perfectly, but Drupal doesn't call the function overrides in tinmanadmin/template.php when used in the context of test.tinman.com.

Instead, in my test install, Drupal executes the base theme function, tinman_preprocess_page instead of having it be overriden by the sub-theme function tinmanadmin_preprocess_page. In the production install this works fine and the sub-theme tinmanadmin_preprocess_page overrides tinman_preprocess_page. The only difference being that the production site has the base theme (/themes/tinman) as the current active theme.

As soon as I make the base theme the current active theme for my test site (previously /sites/test.tinman.com/themes/tinmantest) the overriding works fine.

So it seems that I can rely on sub-themes to inherit everything from the base_theme, but that they will only override the base_theme's template.php functions when that base theme is the active theme.

It seems that the expected behavior would be that the sub-theme should be doing the function overriding no matter what the active theme is. Any help on this would be appreciated.

Comments

theorichel’s picture

I seem to have a similar problem #914746: Cannot get the hijacker to work. Themplate.php and subthemes are incompatibility apparently.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.