[development] module_preprocess_hook not always called

Matt Connolly matt at cabinetuk.com
Tue Jul 29 16:28:55 UTC 2008


No. My question is WHY?

I can see that the preprocess functions are called for theme files and  
not for functions.

I think it would be useful for everything. eg, quote (from http://api.drupal.org/api/function/theme) 
:

--
For example, if a module named "foo" wanted to alter the $submitted  
variable for the hook "node" a preprocess function of  
foo_preprocess_node() can be created to intercept and alter the variable
--

That seems like pretty useful functionality regardless of whether the  
content is generated by a function or a template file.


Another email informing me about "hook_theme_registry_alter" was very  
useful - thanks.

-Matt

On 29/07/2008, at 5:17 PM, Earl Miles wrote:

> Matt Connolly wrote:
>> Is there a reason why a module's preprocess function is not always  
>> called?
>
> The answer to your question is right in the theming documentation: http://drupal.org/node/223430



More information about the development mailing list