Entity hierarchy checks field exists on entity but not bundle
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3414877. --> Reported by: [nterbogt](https://www.drupal.org/user/102218) Related to !29 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <pre>Drupal\Core\Entity\EntityStorageException: Field field_parent is unknown.<br><br>/data/app/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:763<br>/data/app/core/lib/Drupal/Core/Entity/EntityBase.php:347<br>/data/vendor/weitzman/drupal-test-traits/src/DrupalTrait.php:127<br>/data/app/profiles/custom/dcs_profile/tests/src/Functional/DcsTestBase.php:140<br><br>Caused by<br>InvalidArgumentException: Field field_parent is unknown.</pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>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.<br> Add children of the first type to second type.<br> Delete the parent.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Be more defensive.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue