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.
Hi,
have just upgraded due to security issue and I am currently getting this error
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/aegir/contrib/filefield/6.x-3.3/filefield_field.inc on line 275.
i found this closed issue from a while back. Not sure if its related
Comments
Comment #1
marcin-mark CreditAttribution: marcin-mark commentedgot the same error... also, having trouble using scribdfield after updating - getting the error that it can only upload .txt extensions.
Comment #2
quicksketchYou will get this error if you have a corrupted database entry. The specific lines are these:
Basically this means that field_file_load() is not returning a proper file object. Which means that you have a FileField that is referencing a non-existent file entry. Previously FileField would silently fail in this scenario, recent changes (unintentionally) make it much more apparent that something is wrong with the FID that is attempted to be loaded.
Do you get this error on every page or only on certain nodes? You should be able to edit that node and correct the field that is referencing a non-existent file.
Comment #3
quicksketch@marcin-mark: Please open a new issue regarding scribdfield, I'm not familiar with that module.
Comment #4
marcin-mark CreditAttribution: marcin-mark commentedhere's what happened in detail in my situation:
1) i took my site offline
2) i deleted the physical folder in sites/all/modules/filefield
3) i uploaded the new version (stable not dev)
4) while i was uploading the new version i went to update.php
5) the error appeared.
6) before doing the db update i waited for the folder to finish uploading and went into my modules admin page and refreshed it and disabled then enabled and fiddled around for a bit. The error finally went away.
7) i updated the database and i havent seen the error since
i believe i did get the error on the modules page as well as the update.php page
Comment #5
marcin-mark CreditAttribution: marcin-mark commentedwill do, sorry.
Comment #6
giozzz CreditAttribution: giozzz commentedsame problem here, with error displaying on front page
Comment #7
quicksketch@giozzz, the same thing applies to you, this probably only occurs with certain nodes. Could you check the node and make sure that all the files actually exist (in the database "files" table) when viewing/editing those nodes?
Comment #8
giozzz CreditAttribution: giozzz commentedThanks for your response, I've checked right now, and it was one picture missing in the ddblock I have on front page. Sorry for bothering you for nothing and thanks again!
Comment #9
silentsleeper CreditAttribution: silentsleeper commentedI hadnt had a chance to look further into this but it appears as you say the problem is at my end.
There were some missing entries in the file directory. I have fixed this and the problem is resolved.
Thank you for responding.
Comment #10
Ankit22 CreditAttribution: Ankit22 commentedCan you tell me how to remove it ?
Comment #11
ewelch CreditAttribution: ewelch commentednm, fixed it.
Comment #12
david-allen CreditAttribution: david-allen commentedHi Quicksketch
I am also facng this problem. Interesting its not coming on every node but on a particular view. There is a particular view which just lists certain nodes as per classification but after recent update, is throwing this error on those views
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/yourdomain.com/httpdocs/sites/all/modules/filefield/filefield_field.inc on line 275.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/yourdomain.com/httpdocs/sites/all/modules/filefield/filefield_field.inc on line 275.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/yourdomain.com/httpdocs/sites/all/modules/filefield/filefield_field.inc on line 275.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/yourdomain.com/httpdocs/sites/all/modules/filefield/filefield_field.inc on line 275.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/yourdomain.com/httpdocs/sites/all/modules/filefield/filefield_field.inc on line 275.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/yourdomain.com/httpdocs/sites/all/modules/filefield/filefield_field.inc on line 275.
where could be the problem?
Comment #13
quicksketch@david-allen: It's the same as the other users here. You likely are trying to load files from the database that do not exist.
Comment #14
Ankit22 CreditAttribution: Ankit22 commented@quicksketch
Can you tell me ... how to remove this error from the database
Comment #15
david-allen CreditAttribution: david-allen commented@quicksketch
thanks for quick response. Unfortunately i am not able to figure out as whats is causing this problem. Is there a way through which one can identify the error causing file.
I know the fault is entirely at my end but somehow am not able to figure out as am quite newbie.
Comment #16
quaze CreditAttribution: quaze commentedComment #17
czeky CreditAttribution: czeky commentedsame here, any help would be nice..
Comment #18
pietro.a CreditAttribution: pietro.a commentedSame problem here.
I upgraded from filefiled 3.3 to 3.5, and the warning appeared.
It appears, at least once, on every page and for all content types.
Moreover, two more issues:
- I have one content type where i've added an imagefield (already used for other content types) after some nodes were created. This upgrade made this field disappear altogether.
- Image thumbnails added to the teaser of a node (image gallery teaser) via views "node content" function just don't work anymore.
Extremely disappointing...
*EDIT*
For anyone who might incur problems with images after uploading: http://drupal.org/node/492166
In my case, this solved the issue of the warning we are talking about.
Comment #19
quicksketchI've made a change as part of #834018: Data serialized in a field's data column is lost after field_file_load if filefield_meta in use which will effectively "hide" this error again. Previously we were doing this:
Now we're casting it to an array before attempting the merge:
HOWEVER, this still means that something on your site is attempting to load files from the database that no longer exist. This change just silences the problem and nothing shows up. If you want to fix this problem, find out which node is cause the error, use devel module to look at the "load" version of the node (as shown in the Devel Load tab). Finally check that all the files attached to the node have corresponding records in the "files" table. You should be able to fix the problem by editing the node and removing empty file fields and re-saving the node.
Comment #20
quicksketchThis problem should be "fixed" in CVS now, essentially returning the functionality to the way it was in FileField 3.2.
And I should note that even if you were getting this error, it has no negative effect on your site other than the warnings.
Comment #22
MickC CreditAttribution: MickC commentedThis issue is persisting - I can't upgrade from 3.2 until this is resolved.
My data is all loaded directly to the database and has been fine until upgrading. I've been wrestling for some weeks with different versions on my development system, now on 3.9 and still getting the same error:
"Argument #2 is not an array in ../modules/filefield/filefield_field.inc on line 304."
I've tried using Views Bulk Operations to save all relevant nodes, also saving manually. Sometimes it works, sometimes not - I can't see a pattern yet. When editing a node I see this error
"Argument #1 is not an array in ../modules/filefield/filefield_widget.inc on line 253."
I could really do with some help on this one... thanks.
Comment #23
mkoistinen CreditAttribution: mkoistinen commentedHi, I am using 6.x-3.9 with Drupal v6.20.
This issue has started coming up, but only after I installed the FileField Meta module, which was some time after I installed FileField propert and a number of files were uploaded to my site.
Could it be that this 'corruption' that is talked about above, is actually just files that existed before FileField Meta was installed? If so, I hardly see this as corruption at all, but rather a nasty side effect of the installing Meta sometime after its parent module.
I vote that this issue is re-opened.
Comment #24
MickC CreditAttribution: MickC commentedStill no resolution on this - I don't think it's restricted to images, but applies to audio files too, via CCK audio field. Just removed audio files from a node which also had an image, and the error disappeared. When I added an audio file again, the error returned, so it can't be the image file causing the error, has to be the audio files in this case.
Comment #25
prezaeis CreditAttribution: prezaeis commented* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/website_address/sites/default/modules/filefield/filefield_field.inc on line 304.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/website_address/sites/default/modules/filefield/filefield_field.inc on line 304.
the above error is an issue with media tags that needs working on, im willing to help with any of the creators to fix this, please let me know
Comment #26
prezaeis CreditAttribution: prezaeis commentedthe error appears on pages that have a views block which displays a thumbnail of the images that i have set as deafult for filefield
so basically any views displaying content with a thumb of the filefield image, displays this error!!
Comment #27
prezaeis CreditAttribution: prezaeis commentedthis module has some serious coding errors, just looking at the code here i can see 4 errors that could be causing this problem
Comment #28
nickap CreditAttribution: nickap commentedI have the same issue as PRezaei (and others). The error
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/website_address/sites/default/modules/filefield/filefield_field.inc on line 304.
started appearing once I enabled FileField Meta (main FileField module had been enabled for months with no issues). The issue appears on any pages that have either of two views:
-- a 'top stories' listing that is created from a nodequeue
-- a dynamic display block of rotating images.
It is easy to show by removing blocks on the affected pages that these views are what is causing the problem - there is one *warning line for each image in the views.I have checked all the entries in the files table of the database and all have corresponding images in the sites/all/files directory, so that is not the problem.
I am running Drupal 6.20 with FileField/FileField Meta 3.9.
Comment #29
prezaeis CreditAttribution: prezaeis commentedits a nightmare!!
im assuming the views is calling filefield for a certain file or filename from the database which doesnt exists, there cant be something being refered to that doesnt actually exists or something thats missing in the database or named incorrectly.
Comment #30
mkoistinen CreditAttribution: mkoistinen commentedI had this issue when, for some odd reason, my server spontaneously decided to use the PHP4 module instead of PHP5 (both were configured). I too, was pulling my hair out because none of the error messages have any indication that the wrong version of PHP was being used.
my fix was to force PHP5 usage in the .htaccess by adding this line near the top of the .htaccess file in the root of the Drupal install
I hope this helps someone!
Comment #31
prezaeis CreditAttribution: prezaeis commentedno, that wont work, the error is on line 304
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /site address/sites/default/modules/filefield/filefield_field.inc on line 304.
will take a further look later
Comment #32
prezaeis CreditAttribution: prezaeis commentedthis is the line of code in the filefield_field.inc file causing the error:
Comment #33
peter.bod CreditAttribution: peter.bod commentedI had exact same problem with ../filefield_field.inc on line 304 and a few others. I switched off / unticked the FileField Meta in modules and the problem has gone.
Comment #34
jelo CreditAttribution: jelo commentedSub
Comment #35
hey_germanoDoes anyone run into this when creating a new node? Any idea what could be the issue there?
When I upload an image, I get this error on the node/add page: "An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (8 MB) that this server supports." and then the array_merge() error appears in the log. What's interesting is that it works just fine if I disable Javascript. It also works if I browse to my file and then save the node - the image appears just fine. But the error I get when I hit upload is still a problem here.
I've disabled almost every contrib module, and I switched to the Garland theme, but this is still happening.
I don't have Filefield Meta running, and we've got another site on the same server that's using the same version of this module (and Drupal), so I don't think I can blame the server or the PHP version.
Does anybody have any other troubleshooting ideas?
UPDATE: Turns out that this had to do with our .htaccess file. We've got some weird redirects in there that were (I think) messing with Filefield's AJAX callbacks. Anyways... nevermind. :)
Comment #36
oriol_e9gSame problem:
- Enable FileField Meta 6.x-3.9 and appear the warning.
- Disable FileField Meta 6.x-3.9 and disappear.
Comment #37
nonzero CreditAttribution: nonzero commentedFor the warning generated here:
Perhaps we should check both arguments for array type and do a drupal_set_message to warn the user instead of having the user see a cryptic PHP warning. Let's develop a list of causes for this symptom so we can devise a suitable warning message.
Comment #38
nonzero CreditAttribution: nonzero commentedHere's a fix for this warning message when DraggableViews is involved: #1105342: unserialize bug leads to warning: array_merge(): Argument #2 is not an array
Comment #39
Renee S CreditAttribution: Renee S commentedNonzero's patch fixed my problems and didn't seem to create any new ones. Thank you! =)
Comment #40
3dloco CreditAttribution: 3dloco commentedThanks Nonzero! Patch at #1105342: unserialize bug leads to warning: array_merge(): Argument #2 is not an array works for me too!
If using multigroups, see also Szantog's patch at #1105970: Another array_merge error
Comment #41
YesCT CreditAttribution: YesCT commentedCan some information in here help with the filefield array error on line 255 when using editablefields and it's "remove" file button? Is editablefields corrupting a table somewhere? See #972044: Fully support multi-valued CCK fields
Comment #42
quicksketchHum, well among all the various reports of array_merge() errors (I've seen at least 3 issues), I'm not really sure anyone is talking about the same thing any more. I've committed @nonzero's patch over in #1105342: unserialize bug leads to warning: array_merge(): Argument #2 is not an array. Please open new issues and do not open this or other existing issues for new problems.
Comment #43
quicksketchThe 3.10 version of FileField is now available for your downloading pleasure. Please do not reopen this issue. File a new issue against 3.10 for further problems.
Comment #45
bomarmonk CreditAttribution: bomarmonk commentedI posted a new issue for 6.x-3.10 here: http://drupal.org/node/1180508
Comment #46
cealtun CreditAttribution: cealtun commentedvery easy!! just put your site to
/admin/settings/site-maintenance
mode..
update the database.
run the site on again.
must have been solved.
Comment #47
monstordh CreditAttribution: monstordh commentedDitto for me. Problem with the FileField Meta component.