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 17

The 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.

Comments

Matthew Davidson’s picture

Status: Active » Needs review
StatusFileSize
new376 bytes

It's calling the function in content.module before CCK is installed. This patch fixes the problem for me.

drewish’s picture

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?

Matthew Davidson’s picture

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).

drewish’s picture

i think i'd rather see this done with module_load_include(). know of any reason not to?

quicksketch’s picture

It's worth noting that CCK uses

  drupal_load('module', 'content');

Since this the module itself isn't an include.

drewish’s picture

Status: Needs review » Needs work

ah even better... for some reason i thought that was only for D7...

dlhubler’s picture

Status: Needs work » Closed (duplicate)
StatusFileSize
new558 bytes

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

dlhubler’s picture

bump patch

pwolanin’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

did you mean to set this to duplicate?

dlhubler’s picture

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

quicksketch’s picture

Priority: Minor » Critical
StatusFileSize
new1.03 KB

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.

quicksketch’s picture

Status: Reviewed & tested by the community » Needs review

I created a matching patch for ImageField with these same changes #331158: Imagefield Installer Should Ensure content.module's Loading.

drewish’s picture

Status: Needs review » Fixed

thanks committed to HEAD.

quicksketch’s picture

Andrew, I owe you one hug. Thank you. :D

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

The Greenman-dupe’s picture

having this problem to where do i put the patch file to ??