I am having this same issue. What can be done to resolve it? Here is the error as I receive it:

Notice: Undefined variable: term_fields in include() (line 25 of /home/oursite/public_html/testing/SSR_testingD7/themes/gamma/preprocess/preprocess-node.inc)

Comments

Bina Meusl’s picture

We do have exaclty the same problem and if I remember well my colleague already opened a support request time ago. I tried to search for it, but could not find it.

mikeinvaldosta’s picture

Issue tags: +#D7, +omega, +gamma, +term_fields, +preprocess-node

Are you using panels? I am having the same issue and believe it is related to panels.

I am having the same issue, although it is not persistent. In fact I can to a degree predict when it happens.

My landing page is a panel and will produce this error when a new session is started, or when the prior page was another panel. When the prior page was a basic page or web form the error is not present.

This behavior is the same on all other pages. If the referring page was not a standard node (or it was external) the error shows. If a standard content node within the site was the referring page the error does not display.

Perhaps useless info: Another piece of information that may help with resolution: when the error displays the referring content was LANGUAGE: Language Nuetral
when the error doesn't show the referring content was LANGUAGE: Undefined language ()

mikeinvaldosta’s picture

by inserting:
$term_fields = '';
at line 12 of .../gamma/preprocess/preprocess-node.inc
I was able to resolve my issues

Cynthia Ewer’s picture

Subscribing.

Same issue is presenting with a clean install.

No panels.

Fix at post#3 did not resolve the problem.

EDITING TO CLARIFY:

Adding Post#3 fix to existing line 12 didn't work--but creating a NEW line 12 and adding the statement appears to have solved the problem.

Here's the code snip before and after:

/**
 * @todo - make this term manipulation a setting in node display specific theme settings.
 */
foreach ($vars['content'] AS $item) {
  if (isset($item['#field_type'])) {
    $term_fields = '';
    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]);
    }
  }
}

Here's the code snip that appears to work:

/**
 * @todo - make this term manipulation a setting in node display specific theme settings.
 */
$term_fields = '';
foreach ($vars['content'] AS $item) {
  if (isset($item['#field_type'])) {
    $term_fields = '';
    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]);
    }
  }
}
cpelham’s picture

Same problem. Fix in #4 got rid of the error message.

nandt’s picture

solved with 4#
thanks

mac_weber’s picture

subscribing

alexmc’s picture

Perhaps this should be changed to a bug rather than a "support request" because it should be fixed in code in the next release.