Fatal error: Call to undefined function imagefield_widget_settings_save() in /usr/home/hoslo/public_html/sites/all/modules/imagefield/imagefield.module on line 154

This is after upgrade to 6.11

Comments

quicksketch’s picture

Category: bug » support

The function is definitely there, it's at line 186 of imagefield_widget.inc. It sounds like ImageField was not properly installed. I'd suggest deleting the entire "imagefield" directory from sites/all/modules, then recopying it to the server. The imagefield_widget.inc file is pulled in immediately during hook_init() so there's no reason why that function should not exist.

Starminder’s picture

Status: Active » Fixed

Thanks, I put it back in and no problems. Must be another module stomping on it. Thanks!

Status: Fixed » Closed (fixed)

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

greggles’s picture

Fwiw, I get this error when running "drush updatedb" from the command line. I can repeat it consistently.

  module_load_include('inc', 'imagefield', 'imagefield_file');
  module_load_include('inc', 'imagefield', 'imagefield_widget');

Is how the code is loaded, which is as "right" as it can be. Maybe the way that drush runs update.php doesn't call hook_init?

acrollet’s picture

I'm also seeing this using drush fwiw...

greggles’s picture

Category: support » bug
Status: Closed (fixed) » Closed (won't fix)

So, it's a bug. And the solution is to move those includes to the point before the function is called.

I'm marking it "won't fix" since it affects such a small group of people. @quicksketch, if you disagree please re-open and we can see about a fix.

skwashd’s picture

Project: ImageField » Drush
Version: 6.x-3.0 »
Status: Closed (won't fix) » Active
Issue tags: +#provision

Reopening this and moving it to drush based on a discussion with Vertice on #aegir

I have the same symptoms when using imagefield and filefields in an install profile. I have spent days trying to track it down.

hook_init() isn't fired by drush which causes image/file fields to break. I am sure there are other places where code relies on hook_init() which could break too.

In these 2 cases the hook calls module_load_include() which uses require_once() so it is safe to execute this multiple times in a single invocation of drush.

adrian’s picture

I committed a patch for this into provision's drupal 6 install code, that seems to solve the problem.

amitaibu’s picture

Subscribe.

quicksketch’s picture

This should also be corrected by a change in the 3.1 version of ImageField/FileField. See #505860: Fragile during install profiles and #505862: Fragile during install profiles. I'm not sure a change should be made to Drush because the same problem exists when installing a module via an install profile (hence the changes to ImageField and FileField).

moshe weitzman’s picture

Status: Active » Closed (fixed)

reopen as needed.

greggles’s picture

I agree - we've got a pretty good indication that if you're calling your API from your .install you're doing it wrong - http://drupal.org/node/576848

apaderno’s picture

Version: » All-versions-4.2
Component: Code » Base system (internal API)
Issue summary: View changes
Issue tags: -#provision