Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
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
Comment | File | Size | Author |
---|---|---|---|
#10 | filefield_require_once.patch | 1.92 KB | quicksketch |
#10 | imagefield_require_once.patch | 686 bytes | quicksketch |
Comments
Comment #1
quicksketchI 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:
Comment #2
wiifmWell, 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
Comment #3
quicksketchSo is that include line not getting executed? Does Ubuntu come with some kind of op-code cache like APC, XCache, or eAccelerator?
Comment #4
wiifmUbuntu does not come with a default PHP opcode accerator, but I have enabled APC on the server using PECL.
Comment #5
jstamper CreditAttribution: jstamper commentedI 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.
Comment #6
quicksketchThanks jstamper, that sounds very useful. I wonder if we could correct the problem by changing include_once to require_once?
Comment #7
jstamper CreditAttribution: jstamper commentedI 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
Comment #8
quicksketchThanks, 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().Comment #9
wiifmThanks @jstamper,
Edited /etc/php5/conf.d/apc.ini set
restarted apache, and it all worked.
Comment #10
quicksketchI've committed the attached patches to both ImageField and FileField, which effectively switches all calls to include_once with require_once.
Comment #11
quicksketchComment #13
jason.fisher CreditAttribution: jason.fisher commentedFYI -- 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..
Comment #14
HongPong CreditAttribution: HongPong commentedI 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
Comment #15
bluesomewhere CreditAttribution: bluesomewhere commentedThere 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.
Comment #16
jghyde CreditAttribution: jghyde commented#9 worked for me.
Comment #17
drupalninja99 CreditAttribution: drupalninja99 commentedI had the EXACT same issue and I was pulling my hair out, this worked exactly THANKS!
Comment #18
jason.fisher CreditAttribution: jason.fisher commentedI believe PHP 5.3 has improvements that dampen the past advantages of include_once_override.
Comment #19
quicksketchThe 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
Comment #20
jenlamptonJust 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 :)