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

#1

Matthew Davidson - September 2, 2008 - 05:19
Status:active» needs review

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

AttachmentSize
filefield.install-6.x-3.x-cck_include_bug.patch 376 bytes

#2

drewish - September 2, 2008 - 16:37

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

Matthew Davidson - September 2, 2008 - 21:00

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

drewish - September 6, 2008 - 19:57

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

#5

quicksketch - September 6, 2008 - 22:00

It's worth noting that CCK uses

<?php
  drupal_load
('module', 'content');
?>

Since this the module itself isn't an include.

#6

drewish - September 7, 2008 - 00:05
Status:needs review» needs work

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

#7

dlhubler - October 28, 2008 - 19:17
Status:needs work» duplicate

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

AttachmentSize
error_installing_filefield_without_cck_content_first.patch 558 bytes

#8

dlhubler - November 4, 2008 - 04:52

bump patch

#9

pwolanin - November 5, 2008 - 15:15
Status:duplicate» reviewed & tested by the community

did you mean to set this to duplicate?

#10

dlhubler - November 5, 2008 - 15:48

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

quicksketch - November 7, 2008 - 00:24
Priority:minor» critical

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.

AttachmentSize
filefield_content_load.patch 1.03 KB

#12

quicksketch - November 7, 2008 - 00:31
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.

#13

drewish - November 7, 2008 - 00:54
Status:needs review» fixed

thanks committed to HEAD.

#14

quicksketch - November 7, 2008 - 08:18

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

#15

System Message - November 21, 2008 - 08:21
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.