Have a look at function taxonomy_link from taxonomy.module.copyme,v 1.15.2.7, around line 21:

function taxonomy_link($type, $node = NULL) {
  if ($type == 'taxonomy terms') {
    $type = 'categories';
    if (isset($node->taxonomy) && is_array($node->taxonomy)) {
      foreach ($node->taxonomy as $term) {
        $cat = category_get_category($term->tid);
        $node->category[$cid] = $cat;
      }
    }
  }
  elseif ($type == 'node') {
    return array();
  }

  return category_link($type, $node);
}

See $node->category[$cid] = $cat;? I wonder if I'm overlooking something, but isn't $cid always NULL, since it is not initialized anywhere?

If so, this function cannot possibly work.

I can only guess, but I think the code was intended to do $node->category[$cat->cid] = $cat;

Comments

bdragon’s picture

Status: Active » Closed (duplicate)

Excellent catch!

This issue is a subset of the problems in
http://drupal.org/node/74629

I'm marking this issue as a duplicate. Thanks again for the insight!