Well this is a really wierd one, that I was drawn into after seeing comment zebra classes always being marked "even" in my subtheme. I'm hoping someone has some advice of where to look next.

Basically I'm seeing a hook like phpthemplate_preprocess_page being run twice for my sub themes and the Zen Classic example. I've been verfiying this by putting drupal_set_messages in the hooks and looking in the "Theme Registry" via the Devel module.

This doesn't happen with the core Zen theme where phpthemplate_preprocess_page is called once as expected.

I see this with other preprocess_hook's as well, like my comment hook overide being double-executed leaving me with all "even" classes for comments.

Could someone give me a pointer where to look next? I assume phptemplate_preprocess_page() should only be called once for a subtheme, correct?

Thanks!

Comments

Moonshine’s picture

Category: support » bug

On further review, the core Zen _preprocess_hook's are double executed for any .tpl.php templates that a sub-theme has defined. For example I have comment.tpl.php in my subthemes, so phptemplate_preprocess_comment() is called twice for every comment.

Changing this to a "bug", feel free to change it if I'm alone on this.

Moonshine’s picture

I see this weekends commits included one that moves the phptemplate hooks to be zen hooks:

http://drupal.org/cvs?commit=113980

However, in Zen's template.php only theme_breadcrumb() seems to have been changed to zen_? (both calls in template-menus.php were also updated)

Is this on purpose? Only reason I'm asking in this thread is that I think it pertains to why I'm seeing double calls for phptemplate hook calls on subthemes with their own tpl files.

Thanks!

Moonshine’s picture

Assuming this patch makes it into Drupal 6.3:

#252430: Allow BASETHEME_ prefix in preprocessor function names

and Zen changes all it's preprocess functions from:
phptemplate_preprocess_HOOK()

to:
zen_preprocess_HOOK()

then this issue will be resolved.

johnalbin’s picture

Status: Active » Fixed

I just committed a fix for #249532: Allow subthemes to have preprocess hooks without tpl files. that changes all the phptemplate_ functions to zen_ functions. And I believe it works around the #252430: Allow BASETHEME_ prefix in preprocessor function names issue. yay!

Please re-open if I'm mistaken.

Moonshine’s picture

Just gave it a run and it's working well... all preprocess functions are being called correctly here.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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