Posted by duozersk on October 25, 2009 at 8:00pm
Jump to:
| Project: | File (Field) Paths |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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:
<?php
if ($file['status'] == 0) {
$file['data']['process'] = TRUE;
}
?>I managed to fix it by checking the $file variable using the is_array() function:
<?php
if (($file['status'] == 0) && is_array($file)) {
$file['data']['process'] = TRUE;
}
?>Probably, it should be checked in some other place - please advise.
Thanks
Comments
#1
While I was unable to reproduce this issue, there is no harm implementing a check.
Will be committed in next development build.
#2
Committed to DRUPAL-6--1.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.