Fix Taxonomy tests.

Created on 9 May 2023, over 1 year ago
Updated 10 May 2023, over 1 year ago

Problem/Motivation

Currently running the taxonomy tests leads to the following error message:

LogicException: Getting the base fields is not supported for entity type Taxonomy vocabulary.

This is backtraced to the "createAccessFieldTypeOnEntityBundle()" function's "save()" in line 82. It seems, that we can not create a field storage config for the entity type "taxonomy_vocabulary" like this.

Steps to reproduce

Proposed resolution

Create a separate "createAccessFieldTypeOnEntityBundle", function specific to taxonomy vocabularies.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Postponed

Version

2.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Grevil
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: That's funny, perhaps taxonomy_term is the one we need to use?

    See core/modules/taxonomy/src/Entity:

    /**
     * Defines the taxonomy term entity.
     *
     * @ContentEntityType(
     *   id = "taxonomy_term",
    

    vs.

    /**
    * Defines the taxonomy vocabulary entity.
    *
    * @ConfigEntityType(
    * id = "taxonomy_vocabulary",

  • 🇩🇪Germany Anybody Porta Westfalica

    Yeah use: taxonomy_term

    Ugly naming history...

  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil does this still happen? If yes and it's simple to fix, please fix it. If not, leave it open for later, but I think we should then rate this as bug.

  • Assigned to Grevil
  • Status changed to Postponed over 1 year ago
  • 🇩🇪Germany Grevil

    Yea, still no idea, how to properly do this. So "taxonomy_term" is the entity type name? What is the "bundle" name then? The bundle of the created term?? I have no idea...

    Setting "taxonomy_term" as entity type and "$term->bundle()" as the bundle, leads to the error message:

    InvalidArgumentException: Field field_access is unknown.

    Setting both entity type and bundle to "taxonomy_term" OR setting entity type to "taxonomy_term" and bundle to "$vocabulary->bundle()" will lead to:

    LogicException: Missing bundle entity, entity type taxonomy_vocabulary, entity id taxonomy_term.

    Let's postpone this for now.

  • 🇩🇪Germany Anybody Porta Westfalica

    Setting "taxonomy_term" as entity type and "$term->bundle()"

    is the correct one, I think.

    The bundle is for example "tags" here at taxonomy terms, I guess.

    InvalidArgumentException: Field field_access is unknown.

    might be correct, perhaps the field isn't added correctly...

    In contrast to all other entity types, the Config Entity (vocabulary) has a different name here from the Content Entity ("taxonomy_term") while for other entity types it's just node_type => node, ...

    But yes, not important enough so far.

  • Issue was unassigned.
  • 🇩🇪Germany Grevil

    @Anybody, makes sense! Let's fix this in the future!

Production build 0.71.5 2024