I have have no end of issues with this module and PHP 5.3 (specifically 5.3.2-1ubuntu4) running on Ubunutu 10.04. I have added a few hacks, as described in these previous issues by adding in

<?php
module_load_include
('inc', 'filefield', 'filefield_field');
?>

into filefield.module (lines 254 and 273).

Upon creating a new field for a CCK content type (File -> Image), I get the following error:

Fatal error: Call to undefined function filefield_widget_settings_save() in /var/www/sites/all/modules/filefield/filefield.module on line 291

Has anyone had any experience with this? Any solutions?

Thanks in advance
Sean

Comments

I don't think the problems you're describing are PHP 5.3 issues. That said, I'm not sure how you're getting these errors at all. The widget file should be pulled immediately on all requests, since filefield.module includes these lines right at the top of the file:

<?php
// FileField API hooks should always be available.
include_once dirname(__FILE__) . '/field_file.inc';
include_once
dirname(__FILE__) . '/filefield_widget.inc';
?>

Well, I have a Windows XAMPP stack running PHP 5.2 and there are no issues, but porting the exact same code to a Linux based box running PHP 5.3, there are multiple show stoppers (i.e. break critical functionality, and produce WSOD with a PHP error).

See issue #288570: Fatal error: Call to undefined function field_file_load() - for other people running Ubuntu 10.04 with filefield issues

Thanks
Sean

So is that include line not getting executed? Does Ubuntu come with some kind of op-code cache like APC, XCache, or eAccelerator?

Ubuntu does not come with a default PHP opcode accerator, but I have enabled APC on the server using PECL.

So is that include line not getting executed? Does Ubuntu come with some kind of op-code cache like APC, XCache, or eAccelerator?

I like wiifm69 was having a lot of weird filefield errors after upgrading to 10.04. My issue was with APC, I had

apc.include_once_override = 1

set in php.ini. It worked fine in php 5.2.x but it broke filefield when I moved to 10.04 with PHP 5.3. Hope this helps somebody.

Thanks jstamper, that sounds very useful. I wonder if we could correct the problem by changing include_once to require_once?

I had temporarily fixed the issue using module_load_include() which uses require_once instead of include_once so it might not be a bad idea.
Jim

Thanks, that sounds like it might work then. I should note that module_load_include() should not be used directly in module files (outside of any functions) because it ultimately queries the database to get the module location. This causes installation profiles to fail, since they don't have access to the database when the Drupal site is initially installed. That's the reason for our funky use of dirname(__FILE__) instead of the more typical module_load_include().

Thanks @jstamper,

Edited /etc/php5/conf.d/apc.ini set

apc.include_once_override = 0

restarted apache, and it all worked.

Version:6.x-3.3» 6.x-3.5
Status:Active» Fixed
StatusFileSize
new686 bytes
new1.92 KB

I've committed the attached patches to both ImageField and FileField, which effectively switches all calls to include_once with require_once.

Title:Call to undefined function filefield_widget_settings_save()APC setting "apc.include_once_override" causes call to undefined function filefield_widget_settings_save()

Status:Fixed» Closed (fixed)

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

FYI -- still have the error with PHP 5.2 and APC's include_once directive and require_once in the PHP. It works fine with APC if I use a plain 'include' function in filefield.module instead..

I tried switching to dev version and have had this problem with APC and PHP5.3. per wiifm69 suggestion i set apc.include_once_override = 0
and it seems better. woot

There seems to be a general issue with apc.include_once_override and PHP 5.3 -- it had been raising hell in my Drupal 7 install until I discovered this post.

I had issues with a range of modules, including Feeds, CTools, and Date, where an include/require once would be completely ignored, and I'd get undefined function calls left and right.

#9 worked for me.

I had the EXACT same issue and I was pulling my hair out, this worked exactly THANKS!

I believe PHP 5.3 has improvements that dampen the past advantages of include_once_override.

The PHP people have stated (as recently as December at least) that you just shouldn't use this option at all: https://bugs.php.net/bug.php?id=58469

Just a note that if you are using MAMP and have the caching option set to XCache you will have this same problem. Turn it off and all will be happy :)