Install error: Call to undefined function content_notify().
Deciphered - August 29, 2008 - 03:58
| Project: | FileField |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
This is possibly not even worth looking into, but if you have a fresh install of Drupal 6 and the first thing you do is install a module that requires FileField module (and subsequently CCK), you will receive the following error:
Fatal error: Call to undefined function content_notify() in /[path]/filefield/drupal6/filefield.install on line 17The issue appears to be that as it's trying to install FileField and CCK at the same time, the function content_notify doesn't exist with.
It's quite possible that this is a Drupal issue, not a FileField issue, but it seemed appropriate to post here.

#1
It's calling the function in content.module before CCK is installed. This patch fixes the problem for me.
#2
I think it's a bit more core than that... can we be sure that the module is fully installed before we call that function?
#3
I agree the install process shouldn't attempt to install your module before any dependencies are installed and enabled, but on the basis of a quick straw poll of CCK modules, it looks like there's a well-established convention of being kludgy about it and generously sprinkling drupal_load()s or require_once()s through .install files. I think it's worth raising an issue in core, but given people seem happy to work around it, I wouldn't like to bet that a fix would be applied to 6.x, so I think the workaround should be committed here for expediency (following common practice rather than best practice).
#4
i think i'd rather see this done with module_load_include(). know of any reason not to?
#5
It's worth noting that CCK uses
<?phpdrupal_load('module', 'content');
?>
Since this the module itself isn't an include.
#6
ah even better... for some reason i thought that was only for D7...
#7
Submitted patch based on quicksketch's recomemendation and it worked great.
Steps to duplicate
1. Install fresh system
2. Enable filefield module w/o first selecting CCK's content module
3. Confirm prompt that content will also be installed
4. Receive following error (best captured with xdebug installed)
PHP Fatal error: Call to undefined function content_notify() in .../filefield/filefield.install on line 17
#8
bump patch
#9
did you mean to set this to duplicate?
#10
i did not mean to set this to duplicate, thanks for correcting that. i one point i incorrectly created a separate issue and that's probably why
#11
This patch adds the module_load() in every install hook, to match CCK's implementation. See text.install: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/cck/modules....
I'd consider this critical, since you can't turn on the module if turning on content.module at the same time.
- Fresh install
- Try to enable content.module and filefield.module at the same time. Error.
#12
I created a matching patch for ImageField with these same changes #331158: Imagefield Installer Should Ensure content.module's Loading.
#13
thanks committed to HEAD.
#14
Andrew, I owe you one hug. Thank you. :D
#15
Automatically closed -- issue fixed for two weeks with no activity.