Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If node have terms from vocabulary which not linked with current node type (for example — after using Content Taxonomy field with option to save terms to core taxonomy activated), then Term Display is not working for them.
It`s bacause of loading vocabulary list width taxonomy_get_vocabularies().
I`m using this code to load vocabularies:
$vocabularies = array();
foreach ($node->taxonomy as $tid => $term) {
if (!isset($vocabularies[$term->vid])) {
$vocabularies[$term->vid] = taxonomy_vocabulary_load($term->vid);
}
}
instead of
$vocabularies = taxonomy_get_vocabularies($node->type);