The variable $term_fields is declared on the wrong line in preprocess-node.inc, resulting in a notice if no terms are present.

Wrong:

foreach ($vars['content'] AS $item) {
  if (isset($item['#field_type'])) {
    <b>$term_fields = '';</b>
    if ($item['#field_type'] == 'taxonomy_term_reference') {
      //krumo($item);
      $field_name = $item['#field_name'];
      // $term_fields will hold the HTML data from any term_reference field, and be rendered separately in node.tpl.php
      $term_fields .= render($item);
      // hide this "term" element from rendering in $content
      hide($vars['content'][$field_name]);
    }
  }
}

Correct:

<b>$term_fields = '';</b>
foreach ($vars['content'] AS $item) {
  if (isset($item['#field_type'])) {
    if ($item['#field_type'] == 'taxonomy_term_reference') {
      //krumo($item);
      $field_name = $item['#field_name'];
      // $term_fields will hold the HTML data from any term_reference field, and be rendered separately in node.tpl.php
      $term_fields .= render($item);
      // hide this "term" element from rendering in $content
      hide($vars['content'][$field_name]);
    }
  }
}

Comments

Cybso’s picture

Sorry, meant: "... if $vars['content'] is empty."

himerus’s picture

First off, sorry, my email notifications for Gamma issues weren't coming to me...

I'll get this patched quickly, which will also fix a related issue in the queue.

himerus’s picture

Status: Active » Fixed

marking as fixed. Beta2 forthcoming

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cascadianow’s picture

Version: 7.x-2.0-beta1 » 7.x-2.0-beta3
Status: Closed (fixed) » Active

Still receiving this error message, replacing code as shown above seems to fix some pages, but breaks others.