If you fail to enter location information when using Location CCK, you sometimes get a WSOD. Backtracing led me to line 385, in function location_cck_token_values, where apparently, $item['location_settings']['display']['hide'] is NULL, but array_filter expects an array.

Patch attached.

CommentFileSizeAuthor
location.location_array_value.patch1.14 KBaaron

Comments

yesct’s picture

Status: Needs review » Closed (fixed)

aaron, I tried to reproduce this with the latest dev release by making a content type, adding cck location and submitting it with a title but no cck location fields filled out. And it worked ok (no WSOD).
Please report back with exactly the steps to reproduce the WSOD.

the patch no longer applies, and it looks like that line of code is no longer there. At about line 436

function location_cck_token_values($type, $object = NULL) {
  if ($type == 'field') {
    $tokens = array();
    $item = $object[0];
    if ($item['lid']) {
      // If the location exists, we need to set up the tokens.

      $location = array(
        // There is no way to find out which elements to hide because $item does not contain
        // the 'location_settings' element, so for now, just set it to be an empty array.
        // See http://drupal.org/node/463618 for more infomation.
        'hide' => array(),
        'location' => location_load_location($item['lid']),
      );

It might be related to #463618: Field display information not available in the $item array.
?