The most recent Zen code has switched from phptemplate_preprocess_page to zen_preprocess_page in template.php because "phptemplate_HOOK is nonsense with sub-themes." But zen_preprocess_page doesn't get called for my subthemes while phptemplate_preprocess_page was getting called in the earlier version of Zen I was using. This means some setup I expect to be happening isn't happening, notably the wireframes and block editing CSS -- though that has a separate problem which I'll log as another issue with a patch.
If I rename zen_preprocess_page as phptemplate_preprocess_page, it gets called. I tried rebuilding the theme registry with the zen_preprocess_page function but it still doesn't get called as far as I can see.
The Drupal API doc for Default theme implementations says:
While this can vary based upon the theme engine, the standard set by phptemplate is that theme functions should be named either phptemplate_HOOK or THEMENAME_HOOK.... The ENGINE_HOOK() syntax is preferred, as this can be used by sub-themes (which are themes that share code but use different stylesheets).
Garland, for example, uses phptemplate_preprocess_page, not garland_preprocess_page.
That implies that only one THEMENAME_HOOK is called... the one for the current theme and not the base theme. However, this doesn't seem entirely consistent as zen_breadcrumb() seemed to be called in my subtheme when I tested it.
I can't tell from the Preprocess functions doc whether multiple THEMENAME_PREPROCESS functions are supposed to be called or not. It kind of implies there could be a cascade of them when it says:
Although impractical, it is possible to grow this list beyond the ten shown above through sub-theming by adding strictly through the theme name as it is shown in the last two examples.
I'm wondering if Zen should also go back to using phptemplate_preprocess_page instead of zen_preprocess_page so that subthemes don't have to reproduce Zen code in their preprocessing code. Or maybe zen_preprocess_page is supposed to get called for my subtheme but is not for some other reason.
Comments
Comment #1
johnalbinI've reverted back to phptemplate_HOOK for now.
In my opinion, the fact that a sub-theme doesn't call the base theme’s _preprocess_ functions (no matter what they are called) is a bug in D6.
I'll have to investigate further later.
Comment #2
annez commentedI reproduced with a Garland subtheme and logged a bug here #246567: themeName_preprocess_page not getting called for subtheme. Don't know enough about Drupal to track down what's going wrong. Meanwhile, latest version of Zen works for me... and the wireframes and block editing are fixed too. Thx.
Comment #3
johnalbinWhoops. Missed the template-menus.php file. I just committed a change to that file that reverts zen_ back to phptemplate_. http://drupal.org/cvs?commit=111094
Comment #4
annez commentedNever mind about reproducing it with subtheme only... that was just operator error on my part. themeName_preprocess_page seems to work fine for subthemes. The problem with a Zen subtheme and zen_preprocess_page vs. phptemplate_preprocess_page must be something different.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.