Upon viewing a node that has no taxonomy fields, I get this error:

Fatal error: Cannot access empty property in /Users/nate/Sites/grammy4/docroot/modules/field/field.module on line 936

This is because smartqueue.module uses field_get_items() in smartqueue_taxonomy_nodequeue_subqueues(). It's this bit that causes the problem:


  // Check if at least one supported field exists in node and load
  // selected tids.
  foreach (explode('-', $queue->reference) as $field_name) {
    // Save tids.
    if ($field_values = field_get_items('node', $node, $field_name)) {
      $field_names[$field_name] = array();
      foreach ($field_values as $field_value) {
        $field_names[$field_name][] = $field_value['tid'];
      }
    }
  }

If you explode() on an empty string, you end up with an array with one empty object in it (e.g. array('')). This means that field_get_items is called with $field_name = '', which causes the error. This can be fixed simply by using array_filter() to ensure there are no empty items in the resulting exploded array.

CommentFileSizeAuthor
#1 smartqueue_fatal-1943564.patch512 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

FileSize
512 bytes

Status: Needs review » Needs work

The last submitted patch, smartqueue_fatal-1943564.patch, failed testing.

jenlampton’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Issue summary: View changes
Status: Needs work » Needs review

Confirmed this is still an issue in 7.x-2.x-dev. Patch applies. Running tests again.