I run D6. I updated imagefield to the latest version 3.1

I followed the correct update procedure.

I also updated the following modules with it:
link (2.6)
image (1.0 alpha6)
imageapi (1.6)
cck (2.5)
filefield (3.1)

After running update.php I got only one error (from imagefield) which looks like this:
An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.
Please continue to the error page
An error occurred. .../update.php?id=6&op=do
Fatal error: Call to undefined function content_field_tablename() in .../sites/default/modules/imagefield/imagefield.install on line 66

I don't know what to do. Please guide me. I don't want my site to be in maintenance mode for long.

Thanks

Comments

quicksketch’s picture

It sounds like you're upgrading from Drupal 5 or a very old version of ImageField. You need to upgrade CCK first, make sure it's enabled, then run the imagefield updates.

damienmckenna’s picture

There's a related issue I'm running into..

An error occurred. http://mysite/update.php?id=7&op=do <br /> <b>Fatal error</b>: Call to undefined function content_clear_type_cache() in <b>/mysite/sites/all/modules/contrib/imagefield/imagefield.install</b> on line <b>86</b><br />

ImageField should block itself from being updated if it is not enabled, as other CCK fields do.

damienmckenna’s picture

Another idea related to the bug I found - if the CCK module is not enabled then imagefield_update_6004() fails with the error above. Adding the following line to the top of the function resolves the issue:

  module_load_include('module', 'content');
damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.22 KB

Here's a quick patch that makes sure CCK is enabled before running update_6003() and loads content.module for update_6004().

quicksketch’s picture

Version: 6.x-3.1 » 6.x-3.2
Category: support » bug
Priority: Critical » Normal
Status: Needs review » Fixed
StatusFileSize
new1.13 KB

Thanks Damien, committed the attached patch which uses drupal_load() instead of drupal_load_include(), which is the typical approach for loading a .module file.

Status: Fixed » Closed (fixed)

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