I have installed the latest versions of filefield and imagefield but get the white screen of death with the following error mesage every time I try to save a node with an image attached:
Fatal error: Call to undefined function field_file_load() in /home/tom/public_html/drupal-6.x/public/sites/codegobbler.com/modules/filefield/filefield_field.inc on line 79
What I have done:
- Installed imagefiled - it prompted me to install filefield so I did
- added a new imagefield field to the Story node
- Created a new Stroy
- Uploaded an image (the ajax image upload went fine)
- Try to save the new node
And thats when I get the above error. On all subsequent edits of that node (or any other node with an image attached) I get the same error. Once I have the error message on screen, refreshing the page doesn't make it go away, however if I visit another page, and then come back to the node in question, it seems like all the changes I made have been saved, and the image has been successfully attached.
Please excuse me if this issue should have been reported in the imagefield modules bug tracker - The error talks about this module.
Comment | File | Size | Author |
---|---|---|---|
#39 | filefield.patch | 361 bytes | voxpelli |
#19 | filefield_295620.patch | 1.88 KB | drewish |
#16 | filefield_20081009.patch | 2.14 KB | fractile81 |
#10 | filefield_295620.patch | 2.43 KB | drewish |
#9 | filefield.patch | 504 bytes | voxpelli |
Comments
Comment #1
hunthunthunt CreditAttribution: hunthunthunt commentedI get the same problem.
My fix was to add:
module_load_include('inc', 'filefield', 'field_file');
On line 241 of filefield.module (6.x-3.x).
Comment #2
spiffyd CreditAttribution: spiffyd commented@#1.. I can confirm that your fix works. A patch needs to be made about this!
Comment #3
drewish CreditAttribution: drewish commentedyeah a patch needs to be made before this can be marked RTBC.
Comment #4
hunthunthunt CreditAttribution: hunthunthunt commentedWas this fixed in the x4alpha release?
As I am still getting the same bug?
Comment #5
beholder CreditAttribution: beholder commentedI have the same bug on alpha4.
Comment #6
drewish CreditAttribution: drewish commentedmarked #307746: Fatal error by saving the video node as a dupe
Comment #7
ica CreditAttribution: ica commentedi got the same error on line 143
filefield-6.x-3.0-alpha4.tar
imagefield-6.x-3.0-alpha2.tar
cck-6.x-2.0-rc7.tar
views-6.x-2.0-rc2.tar
also tried with
filefield-6.x-3.0.tar
imagefield-6.x-3.x-dev.tar
gives the same error
-not sure of this error might relate to the imagefield module
what combi of this works at to date?
-thanks
----------------------------------------------------------
- correcting my post above the line
somehow filefield module triggered to disabled while i tried to update different versions, i guess this error was result of filefield was not activated
- at the moment this combination works
imagefield-6.x-3.0-alpha2.tar
filefield-6.x-3.0-alpha4.tar
cck-6.x-2.0-rc7.tar
views-6.x-2.0-rc2.tar
please ignore my post above the line as a bug
Comment #8
Flying Drupalist CreditAttribution: Flying Drupalist commentedFatal error: Call to undefined function field_file_load() in /home2/public_html/sites/all/modules/filefield/filefield_field.inc on line 86
I have this problem as well. I'm using:
imagefield-6.x-3.0-alpha2.tar
filefield-6.x-3.0-alpha4.tar
cck-6.x-2.0-rc7.tar
views-6.x-2.0-rc2.tar
and still getting this.
module_load_include('inc', 'filefield', 'field_file');
is already included.
Comment #9
voxpelli CreditAttribution: voxpelli commentedThe fix made by #1 worked for me to. Attaching a patch for it.
Comment #10
drewish CreditAttribution: drewish commentedi've really got no idea why dopry was doing the includes like that. here's a re-roll that should make them a bit saner. could i get someone who'd been running into this problem (i've never encountered it) to test this?
Comment #11
thePanz CreditAttribution: thePanz commentedHI, I'm using latest versions of FileField, CCK, Views2 and ImageField and I had the same issue.
Using patch filefield_295620.patch the issue is gone.. I'll let you know about other issues or errors
Comment #12
mrfelton CreditAttribution: mrfelton commentedI can confirm that filefield_295620.patch fixes the issue.
Latest imagefield, filefield, cck and views
Comment #13
dopry CreditAttribution: dopry commentedComment #14
fractile81 CreditAttribution: fractile81 commentedThere's now two identical calls of
module_load_include('inc', 'filefield', 'filefield_widget');
infilefield_widget_settings();
. Otherwise, the patch looks solid.Comment #15
fractile81 CreditAttribution: fractile81 commentedAlpha5 still doesn't have this patch in it. Without it, setups like mine (not sure if there's anything special about it) will not work at all, throwing a Fatal error and causing a WSOD when trying to edit a node with a file field. Bumping the priority -- worth applying despite the duplicate calls I mentioned before (even though it'd be nice to resolve that, it shouldn't hurt anything, right?).
Comment #16
fractile81 CreditAttribution: fractile81 commentedAttached is a re-roll that also removes the extra include I had mentioned previously.
Comment #17
drewish CreditAttribution: drewish commentedthanks, committed to HEAD.
Comment #18
Moonshine CreditAttribution: Moonshine commentedI'm afraid there was a method to dopry's madness with some of the original code on this one. :/
filefield_widget.inc is a very important file that FAPI/CCK needs for #process building and re-building of forms with filefields *or* imagefields. My guess is that it was put in the init function for this reason. Without it, very bad things happen after validation fails on a form with imagefields where filefield_widget_process() is needed.
At minimum I think filefield_widget.inc needs to be brought back to init. Drewish you can catch me on #drupal.
Comment #19
drewish CreditAttribution: drewish commentedokay, how's this look?
Comment #20
drewish CreditAttribution: drewish commentedfixes a bug i was running into so i'm committing this.
Comment #21
fractile81 CreditAttribution: fractile81 commentedI'm getting this error again when I apply this patch. It appears this error can be resolved by adding
module_load_include('inc', 'filefield', 'field_file');
in thefilefield_field();
function in filefield.module:236. But, if it's being included infilefield_init();
, why wouldn't it already be included here?For clarification, I get this error when I go to edit a node that already has files associated with it (so it has been created with files, then I go back to edit the same node and I get this error).
Comment #22
Moonshine CreditAttribution: Moonshine commentedHmm, that sounds very odd. You may want to try tossing a...
..in filefield_init() and follow it around your site a bit. (Including some form submissions/editing.) If init isn't getting called randomly, then you've certainly got a weird issue that will need further tracking. AFAIK, the only time init isn't called is on fully cached pages.
Comment #23
fractile81 CreditAttribution: fractile81 commentedThere's a partial stacktrace when I get the error. Since I'm using the Taxonomy Theme module, it looks like the
taxonomy_theme_init();
is being called first, which will cause anode_load();
to happen prior to thefilefield_init();
call. At least two options that I can think of:node_load();
be included when needed.I'd lean towards the latter since you can reliably control the code, whereas an end user can arbitrarily change their weights (and not know there's a problem until it's too late...). This latter option was also where the original patch was going. What was the other bug that caused the patch to be reverted? Might it have been weight related as well?
Comment #24
Moonshine CreditAttribution: Moonshine commentedI'd definitely avoid starting the endless weight game, espeically with a cck field module. In the end, these aren't conditional includes anyways. I'd just pull all the module_load_include's out of init and toss them at the top of filefield.module. Then they will all be loaded as part of filefield's base code before any hook init() hits.
Comment #25
Flying Drupalist CreditAttribution: Flying Drupalist commentedI'm still getting this one on the latest dev. What's a patch that works?
Comment #26
Danial Namousi CreditAttribution: Danial Namousi commentedI can confirm this for current dev snapshot.
Comment #27
maurotn CreditAttribution: maurotn commentedI have the same problem if i use filefield with i18n.
Comment #28
TUc CreditAttribution: TUc commentedI'm using FileField 6.x-3.0-alpha5 and imagefield 6.x-3.0-alpha2.
Got the same error:
Fatal error: Call to undefined function field_file_load() in /home2/public_html/sites/all/modules/filefield/filefield_field.inc on line 86
Resolved by simple inclusion of module_load_include('inc', 'filefield', 'field_file') in filefield_field() in filefield.module:
Comment #29
dopry CreditAttribution: dopry commentedyah I think the code to load field_file.inc will have to be global.... :( oh well i thought I could conditionally include it... Are there any other hooks guaranteed to get called on every page load? I haven't been paying close attention to bootstrap changes lately. at the very least lets always include field_file.inc.
Comment #30
dopry CreditAttribution: dopry commentedwhy is hook_init not being called though... personallly I haven't been able to reproduce this. These aren't cached pages, are they?
Comment #31
Moonshine CreditAttribution: Moonshine commentedWell in some of the cases, like #23 above, its just a matter of another module like Taxonomy Theme wanting to do a node_load in its own hook_init. (Which happens to run before filefield)
Comment #32
dopry CreditAttribution: dopry commentedThen I guess it need to go into hook_boot... I tried that locally by failed.. maybe a code registry issue or is that D7?
Comment #33
hunthunthunt CreditAttribution: hunthunthunt commentedThis may shed some light on the issue:
I've tested the same site on 2 different servers, One running PHP 5.1.6 the other PHP 5.2.X - I only experience the issue on the server running PHP 5.1.6.
Hope that helps :)
Comment #34
hunthunthunt CreditAttribution: hunthunthunt commentedI just upgraded PHP 5.1.6 to 5.2.6 and the problem persists. Though I still think this issue has something to do with server config.
Comment #35
Moonshine CreditAttribution: Moonshine commentedWell the code registry would be in d7, but I think 90% of the stuff here is probably just from it getting loaded after some other module is doing a cck related action like node_load in hook_init. hook_boot may be safe, but at that point it might as well just get loaded with the .module I'd think. Or is there some other condition to worry about?
Comment #36
Flying Drupalist CreditAttribution: Flying Drupalist commented#19 worked for me and so I'm hesitant to update to later devs, is this committed yet?
Comment #37
dbeall CreditAttribution: dbeall commentedSame issue, i did the fix from comment #10 and it is working now.. sorry, jumped the gun on that..now has error when i try to upload an image..but it will get me to that point.
update: patch 20081009 has everything working well now. and i tested it this time.
Comment #38
virtualdrupal CreditAttribution: virtualdrupal commentedI'm on the 10/31 dev and the fix in Post#1 worked for me, or clearing my cache... I'll never know for sure
just glad it's gone
--correction below this line---
An hour or so later I realize I'm getting some type of argument array error, I downgraded to alpha 5 and applied the patch in post #28, this solved both problems for me :)
Comment #39
voxpelli CreditAttribution: voxpelli commentedA followup to #1 - why not add it in filefield_field_load() where the actual failure is instead of before?
I'm attaching a patch for that. Seems to be working on 6.x-3.0-alpha5 for me.
Comment #40
dopry CreditAttribution: dopry commentedI went ahead and included field_file.inc at the global level.
Comment #41
ikarusweb CreditAttribution: ikarusweb commentedi have fixed the problem with #39 patch.
thx to all, but we can inside this bugfix in alpha module?
Comment #43
metagrapher CreditAttribution: metagrapher commentedAnd now I have this error instead:
Fatal error: Call to undefined function module_load_includes() in /modules/filefield/filefield_field.inc on line 84
it seems I've just swapped one error for the next...
Comment #44
metagrapher CreditAttribution: metagrapher commentedI should not have changed the title. my bad.
Comment #45
drewish CreditAttribution: drewish commentedlooks like it should be module_load_all_includes() or module_load_include()...
Comment #46
drewish CreditAttribution: drewish commentedmetagrapher, i'm guessing you didn't apply the patch but instead typed it in?
Comment #47
metagrapher CreditAttribution: metagrapher commentedactually, no, I did use patch in solaris. But I did hand copy the patch via vi before applying it. Is it possible that there were non-printable but essential characters that I missed?
Comment #48
metagrapher CreditAttribution: metagrapher commentedNope. Did a diff... no difference.
Comment #49
metagrapher CreditAttribution: metagrapher commentedThis is so odd. So the error is ephemeral. I can recreate it every time by creating a new article. Upon saving the article I get this error. This may actually be more closely related with the MetaTags (aka: nodewords) module. Perhaps I should start a thread in their bug queue, as well?
As mentioned earlier in this thread, I think that this error may have something to do with the order the hooks are called. I suppose that perhaps the MetaTags module is doing something before the FileField module is loaded. Alternatively, the MetaTags module is dependent upon the FileField module due to a way that I have views implemented on my site.
I am going to play with some MetaTags patches and see if that gets me anywhere. In the mean time is it possible that the FileField module needs to be called in a specific order? If so, then it is the responsibility of the module to enforce its place, right?
Comment #50
metagrapher CreditAttribution: metagrapher commentedUPDATE: I have done nothing, but this now works on development, seemingly magically. I don't tend to believe in magic, but I have no other explanation for why this works now. If I come up with a good one though, I'll let you all know! ;)
We'll see how this goes on stage. If it goes well then I will switch the status back to fixed.
Comment #51
metagrapher CreditAttribution: metagrapher commentedAll good. :)
Comment #53
jason.fisher CreditAttribution: jason.fisher commentedI experienced this in 6.x-3.7 and 6.x-3.x-dev.. changed it from require_once to include and it went away. Changed it back and the issue did not return.. ?
Unfortunately not much else I can add.
Comment #54
jason.fisher CreditAttribution: jason.fisher commentedReopening. It happened again, and I can verify that changing the first require_once to an include has corrected the issue.
Comment #55
quicksketchThis is a bug with PHP. See #807680: APC setting "apc.include_once_override" causes call to undefined function filefield_widget_settings_save().
Comment #56
yury216 CreditAttribution: yury216 commentedi have the same problem. I have installed the 6.x-3.9 versions of filefield and imagefield. when i try 2 upload an image attached i have the followin´ error message:
Fatal error: Call to undefined function field_file_urlencode_path() in /var/www/ocu/sites/all/modules/imagefield/imagefield.module on line 377
Can u help me please?
Comment #57
quicksketchThe error you're getting is a different one, and not even in the same module. Please file a new issue.