Skip to content

label not defined in entity keys in taxonomy_entity_info #6867

@bennybobw

Description

@bennybobw

Label is not defined in taxonomy_entity_info entity keys

I looked at the Drupal 7 version of taxonomy_entity_info and it defines label under
I opened an issue over in the 'Title' module where it wasn't checking whether that array key existed and @argiepiano suggested opening a core issue

Current code

in core/modules/taxonomy/taxonomy.module

  $entity_info = array(
    'taxonomy_term' => array(
      'label' => t('Taxonomy term'),
      'bundle label' => t('Vocabulary'),
      'entity class' => 'TaxonomyTerm',
      'controller class' => 'TaxonomyTermController',
      'base table' => 'taxonomy_term_data',
      'token type' => 'term',
      'fieldable' => TRUE,
      'redirect support' => TRUE,
      'entity keys' => array(
        'id' => 'tid',
        'bundle' => 'vocabulary',
      ),

Suggested Code

  $entity_info = array(
    'taxonomy_term' => array(
      'label' => t('Taxonomy term'),
      'bundle label' => t('Vocabulary'),
      'entity class' => 'TaxonomyTerm',
      'controller class' => 'TaxonomyTermController',
      'base table' => 'taxonomy_term_data',
      'token type' => 'term',
      'fieldable' => TRUE,
      'redirect support' => TRUE,
      'entity keys' => array(
        'id' => 'tid',
        'bundle' => 'vocabulary',
        'label' => 'name'
      ),

I don't fully understand what label is notating in this case, so I'll wait for someone else to chime in before creating a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions