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



got the same error... also, having trouble using scribdfield after updating - getting the error that it can only upload .txt extensions.

You will get this error if you have a corrupted database entry. The specific lines are these:

// Load the complete file if a filepath is not available.
if (!empty($item['fid']) && empty($item['filepath'])) {
$items[$delta] = array_merge($item, field_file_load($item['fid']));

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.

@marcin-mark: Please open a new issue regarding scribdfield, I'm not familiar with that module.

here'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

will do, sorry.

same problem here, with error displaying on front page

@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?

Thanks 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!

I 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.

Can you tell me how to remove it ?

nm, fixed it.

Hi 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?

@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.


Can you tell me ... how to remove this error from the database


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.

same here, any help would be nice..

Same 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...

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.

Category:bug» support

I'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:

      $items[$delta]['data'] = array_merge($item['data'], field_file_load($item['fid']));

Now we're casting it to an array before attempting the merge:

      $file = (array) field_file_load($item['fid']);
      if (isset($file['data'])) {
        $items[$delta]['data'] = array_merge($item['data'], $file['data']);
      $items[$delta] = array_merge($item, $file);

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.

Priority:Critical» Normal
Status:Active» Fixed

This 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.

Status:Fixed» Closed (fixed)

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

Version:6.x-3.3» 6.x-3.9

This 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.

Status:Closed (fixed)» Needs review

Hi, 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.

Still 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.

Category:bug» support
Status:Closed (fixed)» Needs review

* 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

the 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!!

this module has some serious coding errors, just looking at the code here i can see 4 errors that could be causing this problem

I 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.

its 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.

I 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

# Somehow, filefield, et al, thought this was a PHP4 server...
AddHandler php5-script php

I hope this helps someone!

no, 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

this is the line of code in the filefield_field.inc file causing the error:

    // Load the complete file if a filepath is not available.
    if (!empty($item['fid']) && empty($item['filepath'])) {
      $file = (array) field_file_load($item['fid']);
      if (isset($file['data'])) {
        $file['data'] = array_merge($file['data'], $items[$delta]['data']);
      $items[$delta] = array_merge($file, $items[$delta]);

I 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.


Does 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. :)

Same problem:
- Enable FileField Meta 6.x-3.9 and appear the warning.
- Disable FileField Meta 6.x-3.9 and disappear.

Status:Needs review» Active

For the warning generated here:

$items[$delta]['data'] = array_merge($item['data'], $file['data']);

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.

Nonzero's patch fixed my problems and didn't seem to create any new ones. Thank you! =)

Thanks 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

Can 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

Category:support» bug
Status:Active» Fixed

Hum, 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.

The 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.

Status:Fixed» Closed (fixed)

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

Category:support» bug
Status:Needs review» Closed (fixed)

I posted a new issue for 6.x-3.10 here: http://drupal.org/node/1180508

very easy!! just put your site to


update the database.

run the site on again.

must have been solved.

Ditto for me. Problem with the FileField Meta component.