Include entities in taxonomy_index

Created on 26 January 2011, almost 14 years ago
Updated 3 September 2023, about 1 year ago

There is the ability to assign taxonomy reference fields to custom entities, but they are not indexed in the same way that taxonomy references are when they're attached to nodes.

For module developers who wish to make use of taxonomy terms it would be useful to index them using the taxonomy_index table in the database. This would be a simple change, removing nid and adding entity_type and entity_id.

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
TaxonomyΒ  β†’

Last updated 2 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @xjm
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡¬πŸ‡§United Kingdom gtipete

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom catch

    This is still a task, or even a feature request, lack of features isn't a bug. We also didn't have generic revision routes/UI until a couple of months ago years after they were theoretically possible, but those were added as features/tasks too.

    It's much easier to have dynamic database tables than it was when this issue was opened, so I would suggest something like this:

    1. Convert the taxonomy_index maintenance code to a service.

    2. Make that service entity-generic and use per-entity-type tables (using a similar pattern to the database cache backend), that will help keep the number of rows per table somewhat under control and save having to store entity_type and querying on it.

    The other option would be to port https://www.drupal.org/project/mv β†’ to Drupal 10 then propose it as an experimental module in core, and then we could drop the taxonomy_index-specific code altogether.

  • πŸ‡ΊπŸ‡ΈUnited States saltednut Chicago

    Not seeing documentation around MV or much usage? Option 2 sounds really doable and doesn't require an experimental module. Converting things over to services has been a goal since we moved to this architecture so I'd lean toward supporting that.

Production build 0.71.5 2024