After installing the latest drupal core and filefield 6.x-3.0-alpha5 my files will no longer display when viewing a node. When a node is edited the files are listed as they should be with their 'List' status enabled. I have also had this error when editing a node:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/ssei/public_html/intranet2/modules/filefield/filefield.module on line 297.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/ssei/public_html/intranet2/modules/filefield/filefield.module on line 297.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/ssei/public_html/intranet2/modules/filefield/filefield_widget.inc on line 173.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/ssei/public_html/intranet2/modules/filefield/filefield_widget.inc on line 173.

Any help would be great!

Comments

ipto’s picture

i have this warning too

craig.bloodworth’s picture

Category: support » bug
Crell’s picture

I can confirm this as well. It seems to only happen when the field is set to Unlimited items. If I set it to a fixed number, it seems to work fine.

thetechguide’s picture

I receive the same error message. Drupal 6.6 and PHP 5.2.5. This appears to be a warning introduced from changes in handling arrays from PHP4 to PHP5. Reference this posting: http://hiveminds.co.uk/hm/node/26

I changed this code at line 297 in filefield.module from:
$element = array(
'#title' => $field['widget']['label'],
'#type' => $field['widget']['type'],
'#default_value' => array_merge(_filefield_default_value($field), $items[$delta]),
'#upload_validators' => filefield_widget_upload_validators($field),
);

to:
$element = array(
'#title' => $field['widget']['label'],
'#type' => $field['widget']['type'],
'#default_value' => array_merge( (array) _filefield_default_value($field), (array) $items[$delta]),
'#upload_validators' => (array) filefield_widget_upload_validators($field),
);

That solved the errors for me. But really, I have no idea what I am doing, so please confirm if this is even correct and/or introduces any other problems :)

Crell’s picture

Could this be related to #289924: Warning during update a node?

jbrauer’s picture

Version: 6.x-3.0-alpha5 » 6.x-3.x-dev
Component: User interface » Code
Status: Active » Fixed

I did some testing and came up with a patch that was similar to #4. However upon checking out from CVS to make the patch found that this issue is resolved with the latest CVS (possibly with some other patches from today?)

Status: Fixed » Closed (fixed)

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