Closed (fixed)
Project:
File (Field) Paths
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Oct 2009 at 20:00 UTC
Updated:
11 Nov 2009 at 03:10 UTC
Hello!
To reproduce you should just create the filefield with unlimited values (so that you have the "Add another item" button on the node editing form).
The reason if that this button ("Add another item") is returned as a separate field of type "filefield" and is being processed. But the resulting $file variable in the code is just a string "Add another item" and is not an array. Thus, this code generates the fatal error:
if ($file['status'] == 0) {
$file['data']['process'] = TRUE;
}
I managed to fix it by checking the $file variable using the is_array() function:
if (($file['status'] == 0) && is_array($file)) {
$file['data']['process'] = TRUE;
}
Probably, it should be checked in some other place - please advise.
Thanks
Comments
Comment #1
decipheredWhile I was unable to reproduce this issue, there is no harm implementing a check.
Will be committed in next development build.
Comment #2
decipheredCommitted to DRUPAL-6--1.