[drupal-devel] Cache sid

Julian Bond julian_bond at voidstar.com
Tue Mar 1 19:06:26 UTC 2005

Julian Bond <julian_bond at voidstar.com> Tue, 1 Mar 2005 18:41:15
>Hmmm. Maybe I shouldn't be calling functions in common.inc during the 
>module_init hook.
>I was trying to add a style sheet and a javascript file to the <head> 
>of every page using quicktags_init() as an example.

I think there may be a sequence problem here

include_once 'includes/bootstrap.inc';
include_once 'includes/common.inc';

If the cache is turned on drupal_page_header() calls

which calls
     module_invoke($module, $op);

So module functions can be called before common.inc is loaded, but only 
if cache is turned on and it's a guest user coming in. And it seems 
quite possible that module writers would use functions that are only 
available *after* common.inc is loaded.

Julian Bond Email&MSM: julian.bond at voidstar.com
Webmaster:                 http://www.ecademy.com/
Personal WebLog:          http://www.voidstar.com/
M: +44 (0)77 5907 2173      T: +44 (0)192 0412 433
S: callto://julian.bond/

More information about the drupal-devel mailing list