Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
On line 322 of filefield_widget.inc:
if (isset($item['data']['description'])) {
unset($item['data']['description']);
}
if $item['data'] has a string value, the isset() will evaluate as true, and then line 23 will fail. As an example, the following fails with Fatal error: Cannot unset string offsets:
$item = array();
$item['data'] = 'foo';
if (isset($item['data']['description'])) {
unset($item['data']['description']);
}
Patch attached but not sure if its the best solution.
Comment | File | Size | Author |
---|---|---|---|
#2 | filefield-443228-2-fix-php-string-array-oddness.patch | 503 bytes | mikeytown2 |
filefield_description_patch.patch | 748 bytes | gdd |
Comments
Comment #1
gddComment #2
mikeytown2 CreditAttribution: mikeytown2 commentedRan into this today. Originally patch is missing a ")" on the is_array().
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedI need a vacation.
#1415840: Fatal error: Cannot unset string offsets