On a site where CCK is not activated, CCK gives this error when I run the updatescript.

An error occurred. http://www.site.com/update.php?id=28&op=do Fatal error: Call to undefined function content_fields() in /fnord/www/sites/all/modules/cck/content.install on line 533

CommentFileSizeAuthor
#11 2.3-cck-update-482774.patch2.91 KBpwolanin

Comments

lyricnz’s picture

I have this too.

lyricnz’s picture

I had CCK enabled, before replacing "cck" directory with files from 6.x-2.3 release. When I ran update.php, I got this error, then when I checked the module page, CCK was showing as *disabled*. I disabled a couple of other modules (emfield, as it happens), then CCK appeared to show up enabled again (wierd). After CCK was enabled, I ran update.php again, and it worked fine.

yched’s picture

Crap. Missing drupal_load('module', 'content'); at the beginning of update 6004. Forgot about that nice aspect of the update system, and it didn't get reported during the time this code lived in -dev.

I'm not where I can roll a fix right now, but it seems we're up for an early 2.4 release :-(

yched’s picture

fixed in -dev. Will roll a 2.4 shortly, waiting to see if other hotfixes need to get in.

yched’s picture

Status: Active » Fixed
bmcraec’s picture

Had the same problem while upgrading a site last night (6.12 core). All 2rd party modules where disabled when Update.php was run, producing the error in question. When I read through the comments here, I went enabled all the 3rd party modules, ran Update.php again, and lo and behold, no errors!

Currently, everything seems to be working fine!

caschbre’s picture

I too had the very same error.

I didn't want to install the dev release to get the fix, but after reading some of the comments here is what I did:

Went to my modules page (where I had all 3rd party mods disabled). I enabled the CCK core module only and then re-ran update.php. 6010 was installed successfully. I'm not sure if that is right or if that even works, but so far so good.

yched’s picture

Note that you don't need to disable contrib modules if you only do a contrib module update. It is only required for core major version upgrade.

Anonymous’s picture

Just ran into this update. Ended up having to uninstall CCK and reinstalling it. This was on a dev site that I had left alone for awhile.

andrewsuth’s picture

I got the same error under the same conditions as explained in the original post. I was upgrading from CCK 2.2 to CCK 2.3

As this site does not use CCK, the work-around I used was to set the update drop-down to No updates available

pwolanin’s picture

StatusFileSize
new2.91 KB

Here's a patch to use based on the CVS commit.

yched’s picture

I rolled release 2.4 today.

bsimon’s picture

Thanks for the bug fix!

Could I suggest in future withdrawing an update and making it unavailable if it has a bug like this, assuming that's possible. I just installed 6.x-2.3 20 minutes ago... and got hit with this bug.

It's almost funny really... I always wait at least a week before updating a module because I didn't want to get caught out like this again :/

Also, in my opinion, it seems likely to cause serious confusion that this issue was marked as 'fixed' when this bug actually still existed in 6.x-2.3, and people were still able to download it. This makes it much harder for users to find serious issues before installing an update like this.

I hope these suggestions are helpful and apologize in advance if I've misunderstood something here (which is certainly possible). Thanks again for all your great work.

yched’s picture

We cannot withdraw a release if there is no newer release yet. The bug was not so bad it would have deserved pulling the 2.3 release out completely.

About marking the issue 'fixed' : that's how issue queues work. A bug is marked 'fixed' if it's fixed in -dev.

I waited a bit to release 2.4 to see if 2.3 needed other hotfixes. This being said, I should probably have updated the 2.3 release notes meanwhile, to state that a bug in the update function required some simple precautions before running update.php.
Sorry about the confusion.

bsimon’s picture

Thanks for the explanation. It seems like the problem is really an inevitable result of structural issues with Drupal.org and the CVS...

stevea3’s picture

I get the following comment when I try to activate module CCK release 6.x-2.4:

Fatal error: Call to undefined function content_field_instance_read() in /home/blackcre/public_html/sites/all/modules/content/content.module on line 1475.

When I remove the newly installed CCK release 6.x-2.4 module, the error goes away. I need this module to run the mp3player module.

Was this release supposed to fix this problem? If so, is there something I am overlooking?

Stevea3

markus_petrux’s picture

@stevea3: Make sure you have extracted all files in the CCK package with the proper directory structure and permissions.

Visually backtracing the code:

a) Line 1475 in content.module invokes function content_field_instance_read(). Failed, but why?
b) Function content_field_instance_read() is defined in file includes/content.crud
c) Before line 1475 in content.module, the file includes/content.crud is loaded in line 1469 !!!

So, it seems c) failed, probably because the file isn't there, or it doesn't have the proper permissions.

stevea3’s picture

Version: 6.x-2.3 » 6.x-2.4

Thank you very much, markus_petrux. The directory structure was not there.

Now it works great.

Status: Fixed » Closed (fixed)

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