Entity hierarchy checks field exists on entity but not bundle

Created on 15 January 2024, 5 months ago
Updated 25 April 2024, 2 months ago

Problem/Motivation

Drupal\Core\Entity\EntityStorageException: Field field_parent is unknown.

/data/app/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:763
/data/app/core/lib/Drupal/Core/Entity/EntityBase.php:347
/data/vendor/weitzman/drupal-test-traits/src/DrupalTrait.php:127
/data/app/profiles/custom/dcs_profile/tests/src/Functional/DcsTestBase.php:140

Caused by
InvalidArgumentException: Field field_parent is unknown.

Steps to reproduce

Create two bundles for a node. Allow one to have the parent field and make the other be an allowed bundle for the parent field.
Add children of the first type to second type.
Delete the parent.

Proposed resolution

Be more defensive.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

5.0

Component

Code (module)

Created by

πŸ‡¦πŸ‡ΊAustralia nterbogt

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024