This issue comes out of a discussion with davmorr in #1135198: noscript tag not being rendered in the output starting around #4
According to davmorr this code is not working right because of array/object issues:
// If this is a term page, grab the term.
if (arg(0) == 'taxonomy' && is_numeric(arg(2))) {
$terms = taxonomy_get_term(arg(2));
}
Instead, davmorr::
Re the code [above], the $terms var being passed to the foreach from a node is an array of objects. From a taxonomy list page, it is just be handed an object. In PHP5, if you pass an object to a foreach loop, it gets iterated like an array - http://www.php.net/manual/en/language.oop5.iterations.php - which is what is happening here.
Do a 'dsm(gettype($terms));' on line 218 and test on a node page and a taxonomy list page. You can also dsm() $term inside the foreach for kicks.
This can easily be fixed by changing the $terms var from scalar to array in the taxonomy term page conditional:
line 214 (dart_taxonomy.module):
// If this is a term page, grab the term. if (arg(0) == 'taxonomy' && is_numeric(arg(2))) { // change $terms to $terms[0] $terms[0] = taxonomy_get_term(arg(2)); }
Comments
Comment #1
bleen commentedcommitted this fix to dev (6.x) ... it had already been fixed in 7.x