Fatal error: Call to undefined function filefield_get_file_reference_count() in /sites/all/modules/filefield/filefield_field.inc on line 200

This error occurs in 2 scenarios when saving node(profile).

1. Remove image and save node.
2. Upload an image to replace current and save node.

Why is this happening? I recently updated FileFeild and ImageField. But I update FileField first.

Comments

quicksketch’s picture

Make sure you updated all the files in the filefield module directory. I'd suggest deleting the entire module directory and uploading the entire new one. It sounds like field_file.inc was updated but not filefield.module. The function is quite clearly there at line 751 of filefield.module.

Anonymous’s picture

These are the options in my update drop down for FileField. Do i go with the single digit or the 4 digit?

1
2
3
4
6000
6001
6002
6003
6004
6005
6006
6007

quicksketch’s picture

Don't change the options at all. Drupal automatically selects the one that needs to be run for you. Running an update twice (or skipping an update) will almost certainly damage your database. The ability to change the update function was put in place for developers, but clearly this has caused a lot of confusion. This ability has been removed entirely from Drupal 7 to prevent such mistakes.

Anonymous’s picture

I did not know that. All the module updating instructions I have read never mentioned that. That is invaluable information. Thanks for that!

So I reinstalled the FileField and ImageField modules and ran the update.php. I received the following message after running the update but it seems to have corrected the problem. No more errors. Should I be concerned with the following?

The following queries were executed
filefield module
Update #6104

  • DELETE FROM {system} WHERE type = 'module' AND name = 'filefield_token'
quicksketch’s picture

Status: Active » Fixed

Should I be concerned with the following?

Nope, not at all. The FileField Token module was merged into FileField and is no longer a separate module. See the discussion in #421220: Cannot redeclare filefield_token_list().

Sounds like this problem is fixed. Thanks for the followup. :-)

Status: Fixed » Closed (fixed)

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