Active
Project:
Gamma
Version:
7.x-2.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2011 at 16:49 UTC
Updated:
26 Feb 2011 at 01:40 UTC
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
Comment #1
Cybso commentedSorry, meant: "... if $vars['content'] is empty."
Comment #2
himerus commentedFirst 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.
Comment #3
himerus commentedmarking as fixed. Beta2 forthcoming
Comment #5
cascadianow commentedStill receiving this error message, replacing code as shown above seems to fix some pages, but breaks others.