I get this error after editing a node, adding an attachment and then clicking save:
Fatal error: Call to undefined function field_file_load() in /home/tom/public_html/drupal-6.x/public/sites/playhouseharlow.com/modules/filefield/filefield_field.inc on line 79
Since that, I get a white screen with that error message every time I try to view that node.
(dev snapshot from 26/07)
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | apc.png | 44.31 KB | quicksketch |
| #17 | drupal_get_path-288570-17.patch | 1.22 KB | brentaar |
| #11 | issue-288570.patch | 497 bytes | nick_vh |
| #10 | issue-288570.patch | 497 bytes | nick_vh |
Comments
Comment #1
drewish commentedi'd make sure you're running the latest code... it should be okay.
Comment #2
dopry commentedcannot reproduce.
Comment #3
sjf commentedI had the same problem. Disabling the Comment RSS module - http://drupal.org/project/commentrss - seemed to fix it.
Comment #4
japanitrat commentedsame problem here, did not installed commentrss
Comment #5
japanitrat commentedseems like problem found in filefield_field() (filefield.module:246), where the filefield_field is loaded and a function inside dynamically gets called. (in this case filefield_field_load which demands field_file_load to be included, which is not)
so I added
module_load_include('inc', 'filefield', 'field_file');in line 247, and the error disappears.Comment #6
spiffyd commentedDisabling Comment RSS did fix it for me as well.
Comment #7
Babalu commentedsame
Comment #8
igorik commentedsame problem, don't have comment rss
Comment #9
igorik commentedI include full error message in Internet Explorer:
An error occured.
/filefield/ahah/uprofile/field_ikonka/0
<br />
<b>Fatal error</b>: Call to undefined function _filefield_default_value() in <b>/home/... /www/sites/all/modules/filefield_widget.inc</b> on line <b>195</b><br />
Comment #10
nick_vhI had the same error on Drupal 6.16 running latest filefield and imagefield (Filefield Dev) and this happened when I upgraded ubuntu to new 10.04.
Not sure if this has anything to do with it but ok!
Fatal error: Call to undefined function field_file_load() in /media/disk/workspace/prive_hortet/www/sites/all/modules/contrib/filefield/filefield_field.inc on line 134
Fix :
Go to filefield.module and add module_load_include('inc', 'filefield', 'field_file'); in line 270
Also a patch in included.
Some debug information :
Drupal 6.16
MySQL database 5.1.41
PHP 5.3.2-1ubuntu4
Comment #11
nick_vhWrong patch (wrongly diffed) - correct patch included here
Comment #12
lelizondo commentedI'm getting a similar error, just in another file:
I know field_file_load() is in filefield.module, should I add a module_load_include to the function in the .module?
Comment #13
quicksketch@lelizondob, opening a new issue probably would've been a better course of action, since this is likely a different cause. What are the steps you use to reproduce this issue? If you're running 3.7, you shouldn't have this problem, at least if it's the same as #807680: APC setting "apc.include_once_override" causes call to undefined function filefield_widget_settings_save().
It seems like recent PHP versions have just started to ignore require and include requests, but I have no idea how or why these files would not be included.
Comment #14
machinez commentedI was getting a similar error in Pressflow 6.17. Adding #10 fixed the problem. But I realized the Mercury instance was built on php 5.3 reverted to 5.2. Hack was not needed.
Instructions on downgrading php on Ubuntu 10.04 lucid to karmic
http://www.nickveenhof.be/blog/reverting-or-downgrading-php-53-52-ubuntu...
Comment #15
lelizondo commented@quicksketch The problem was related to PHP 5.3, once I downgraded to 5.2.x the problem was solved with no hacks needed. I'm sorry, I just forgot to mark this as fixed.
Comment #17
brentaar commentedI'm trying to upgrade some servers to PHP 5.3 and in my testing the FileField module was giving me a white screen.
This seems to stem from the different ways PHP 5.2 and 5.3 handle dirname(__FILE__). I tried using drupal_get_path('module','filefield'), which seemed to fix the issue in PHP 5.3. I did some quick testing in PHP 5.2 and it appeared to work properly.
If the patch I'm submitting could be reviewed and then applied, the servers will be one step closer to using PHP5.3.
Comment #18
quicksketchWe can't use drupal_get_path() because it ultimately requires a database connection. In some situations (such as install profiles), the .module file is loaded before the database connection is available, causing the installation to fail.
Some versions of PHP 5.3 have an issue with the caching of files that are included. See #807680: APC setting "apc.include_once_override" causes call to undefined function filefield_widget_settings_save().
Comment #19
brentaar commentedOk, thanks.
Comment #20
brentaar commentedFor understanding.
Looking at the drupal_get_path() function it does not require a database connection. It would like one, but it appears to default back to the filesystem if the db connection is not available.
drupal_get_path() uses drupal_get_file(), which can use the DB, but does try other methods.
I'm just trying to understand and not push the issue.
Comment #21
quicksketchLooks like you're correct. I'm not sure if drupal_get_path() had a bug in it at some point or I'm basing my comments off of other problems like #317417: Fix off-line maintenance page since drupal_get_path('theme', 'zen') won't work and #1136820: Allow drupal_get_filename() to work with the installed profile..
Although ultimately I'm still curious why dirname(__FILE__) fails. What difference does it give you between PHP 5.2 and PHP 5.3?
Comment #22
brentaar commentedIt looks like drupal_get_path() was not following the Drupal hierarchy properly, meaning it was not looking in the correct places for themes and probably profiles, or at least that is what I understand from those bugs.
Following links drupal_get_path() should be fixed in newer versions of Drupal.
For dirname(__FILE__) failing, my guess...something to do with a Magic constant that is not being saved to a variable, when it gets run in APC, that looses the file due to it being in cache.Though what happened from php5.2 to php5.3 change this functionality is unknown to me.
Comment #23
gateway69 commentedI also ran into this issue, it turns out on my end that apc is also killing __FILE__ I found in my /etc/php5/conf.d/apc.ini that I had apc.include_once_override = 1 set, disabling this and then restarting apache fixed my issue if anyone else is running into this.
from the php site I found this
Comment #24
quicksketchI don't think we'll change the include behavior at this point. It seems like PHP may have shipped with this directive enabled (or it was enabled by some hosting providers). PHP now provides a nice huge error basically saying "don't use apc.include_once_override": http://www.php.net/manual/en/apc.configuration.php#ini.apc.include-once-...
So basically, I think this boiled down to a PHP bug that we shouldn't be accommodating for.