Use bundle entity key instead of 'type' for loading entities

Created on 24 July 2023, almost 2 years ago

Problem/Motivation

Entities can describe the property/field to be used as bundle via entity key "bundle". Whereas node entities as well as a lot of other define "type" as bundle key, there may be entities that use a different bundle key. This module will not work with those entities.

Steps to reproduce

Use an entity type with a different bundle key than "type" together with this module. You will see an error something like:
Drupal\Core\Entity\Query\QueryException: 'type' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable()

Proposed resolution

Use entity definition to get entities bundle key.

Remaining tasks

Provide patch

User interface changes

na

API changes

na

Data model changes

na

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇩🇪Germany stefan.korn Jossgrund

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

Comments & Activities

Production build 0.71.5 2024