Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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
Comment #1
nickap CreditAttribution: nickap commentedI 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.
Comment #2
oscarwerther CreditAttribution: oscarwerther commentedworks like a charm - thank you
Comment #3
quicksketchThis has been fixed in #2033023: warning: array_merge() [function.array-merge]: Argument #2 is not an array - back in version 6.x-3.11.