This is a bug report/feature request I've been meaning to submit for a while.
If you go take a gander at http://drupal.org/node/223430, you’ll notice two “notes” about why you should never use engineName_preprocess or engineName_preprocess_hook as the name for your preprocess functions.
A few examples makes things clearer. Imagine you have this basetheme->subtheme hierarchy:
* subtheme1 (basetheme is its parent)
* subtheme2 (subtheme1 is its parent)
- If the base theme has a phptemplate_preprocess function, the theme registry loads all 3 theme’s template.php files and has no way to know which theme owns the phptemplate_ prefixed preprocess function. Thus, that phptemplate_preprocess function gets registered by ALL 3 of those themes and gets run three times instead of once. ouch!
- Worse case: if the base theme defines phptemplate_preprocess() and then a un-observant subtheme1 creates the exact same function in its template.php, the unlucky themer will get a Fatal PHP error and possible WSOD (White screen of Death)! yay.
- Here's another awful consequence: Let's say that both the basetheme and the subtheme1 want to override theme_links. If basetheme defines a basetheme_links() and subtheme1 defines a phptemplate_links(), the one defined by subtheme1 should be used, but themeEngineName_links is assumed to be less specific than themeName_links, so subtheme1's phptemplate_links() override is ignored in deference to the basetheme_links() override.
The original rationale for allowing themeEngineName prefixes was “This makes it easier to move around code between themes and post snippets on Drupal.org.” But we already require themers to copy theme functions from modules and rename them from theme_function() to themeName_function(), so the copy-and-rename-function meme is already out there. Plus, copy-and-rename will help themers who are new to programming concepts understand that you can't give 2 functions the same name.
“Portability of function names” is a crutch that we shouldn't be giving to beginning themers. It just turns them into cripples. We should teach them a little PHP the right way so we don't confuse them more later.
Solution: remove themeEngineName from the list of allowed preprocessor function and theme function prefixes. Note, themeEngineName_engine prefixes are still fine since they apply to theme engines and not to themes.