Seeing this error message: Warning: array_merge() [function.array-merge]: Argument #2 is not an array in filefield_field_sanitize(). This is occurring on line 309 in filefield/filefield_field.inc. Need to check that the argument is an array before running array_merge().

Current code:

      if (isset($file['data'])) {
        $file['data'] = array_merge($file['data'], $items[$delta]['data']);
      }

Suggested change:

      if (isset($file['data']) && is_array($items[$delta]['data'])) {
        $file['data'] = array_merge($file['data'], $items[$delta]['data']);
      }

Comments

nickap’s picture

Version: 6.x-3.10 » 6.x-3.11

I have the same issue coming up with version 6.x-3.11; this time in filefield_field.inc -
"Array_merge(): argument #2 is not an array" on line 309.

oscarwerther’s picture

if (isset($file['data']) && isset($items[$delta]['data'])) {

works like a charm - thank you

quicksketch’s picture

Status: Fixed » Closed (fixed)

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