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

Michael Prasuhn mike at mikeyp.net
Fri Nov 30 08:10:16 UTC 2007


On Nov 29, 2007, at 11:12 PM, Augustin (Beginner) wrote:

> When creating an install profile, one runs against such errors:
> "Fatal error: Call to undefined function xxx()"
> http://www.google.com/search?q=site%3Adrupal.org+profile+install+Fatal+error%3A+Call+to+undefined+function
>
> This happens when one includes a few specific modules in
> hook_profile_modules(), including book.module:
> http://drupal.org/node/164458#comment-643884

I'd consider filing an issue against book.module in this case.

> The api says that all functions are loaded when running
> hook_install():

> But the profile documentation implies the contrary:
> http://drupal.org/node/67921

Don't mix up hook_install and hook_profile_* hooks. They are for  
rather different purpose. hook_install is for modules to implement  
when they are first enabled, and hook_profile_* are only run during  
the initial installation of Drupal. These are actually two separate  
installations, except for the fact the the module installation can be  
triggered during the Drupal installation.

...

Actually I just went and read the issue you mentioned. I think  
pwolanin pretty much nails the issue in the first comment <http://drupal.org/node/164458#comment-588665 
 >. Book is trying to call function from node.module, and while in  
theory all core functions are enabled, from a full bootstrap, Drupal  
can't yet have a full bootstrap if you are enabling modules such as  
node and system at the same time.

One solution might be, to enable book.module from hook_profile_final.  
Any attempts to include files, from modules not yet installed will  
most likely result in Bad-Things. *

-Mike


* When I first read your mail, I thought you were referring to the  
type of problem that is common with contrib modules that make  
extensive use of .inc files. These tend to wreak havoc on install  
profiles (call to undefined function), and my solution to these  
problems has been a string of include_once() at the top of my install  
profile.


__________________
Michael Prasuhn
mike at mikeyp.net
http://mikeyp.net
949.200.7595
714.356.0168 cell
949.200.7670 fax





More information about the development mailing list