Problem/Motivation

In ds_entity_variables(), the bundle is extracted from $vars['elements']['#bundle'], but immediately overridden by the call to entity_extract_ids() below. Normally, this is fine because they are (should be) the same value. However, in the case of taxonomy, this isn't true.

The "bundle" provided is actually the vocabulary machine name and because taxonomy's don't have [official] bundles, entity_extract_ids() just returns the entity type as the bundle, thus the unique vocabulary "bundle" is overridden with term. This results in theme hook suggestions like layout_id__taxonomy_term__term instead of layout_id__taxonomy_term__vocabulary.

Proposed resolution

Use different variable names for the info returned from entity_extract_ids() and only use them if they're not already set.

Remaining tasks

  • Create a patch

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markcarver created an issue. See original summary.

markhalliwell’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.17 KB