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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gdd’s picture

Status: Needs review » Closed (won't fix)
mikeytown2’s picture

Status: Closed (won't fix) » Needs review
FileSize
503 bytes

Ran into this today. Originally patch is missing a ")" on the is_array().

mikeytown2’s picture

Status: Needs review » Closed (duplicate)