[development] Fatal error : install profiles and the use of hook_install

Augustin (Beginner) drupal.beginner at wechange.org
Fri Nov 30 07:12:19 UTC 2007


There seem to be a critical bugs hiding behind the way the install 
profiles are implemented.
At the very least, there seem to be a gross inconsistency in the 
I could have fixed the api documentation myself, except that I am not 
sure what is the 'normal' behavior.

When creating an install profile, one runs against such errors:
"Fatal error: Call to undefined function xxx()"

This happens when one includes a few specific modules in 
hook_profile_modules(), including book.module:

The api says that all functions are loaded when running 

"Note that since this function is called from a full bootstrap, all 
functions (including those in modules enabled by the current page 
request) are available when this hook is called. Use cases could be 
displaying a user message, or calling a module function necessary for 
initial setup, etc."

But the profile documentation implies the contrary:
the modules (including core required modules and their functions) are 
NOT yet included when running hook_profile_modules() (which calls 
hook_install()). The modules are included only at a later stage, 

A similar problem occurred with forum.module, until a certain function 
call was moved to hook_enable():

This begs the question: what is it ok to include in hook_install()? 
Is hook_install() only for the DB schema, or can heavier lifting be 
done using any function call?

If this cannot be fixed for D6, some warning should be included in the 
documentation, especially here: http://drupal.org/node/67921 .
I didn't do so myself because I am uncertain about all the above.



More information about the development mailing list