BundleClassInheritanceException
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3574779. --> Reported by: [promes](https://www.drupal.org/user/80259) Related to !168 !166 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>After update to version 3.0.0 I got this error:<br> 'PHP message: Uncaught PHP Exception Drupal\\Core\\Entity\\Exception\\BundleClassInheritanceException: "Bundle class Drupal\\my_node\\Entity\\Bundle\\PersoonNode does not extend entity class Drupal\\book\\Entity\\Node\\Book." at /xxx/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php line 216'</p> <p>My module is allready working for 2 years.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Create a new Drupal 11.3 site<br> Create a custom module with in the my_module.module file this function:</p> <pre>function my_node_entity_bundle_info_alter(array &amp;$bundles): void {<br>&nbsp; foreach ($bundles['node'] as $bundle =&gt; $data) {<br>&nbsp;&nbsp;&nbsp; if ($bundle == 'persoon') {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $bundles['node']['persoon']['class'] = PersoonNode::class;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br>}</pre><p> Create in src\Entity\Bundle a file PersoonNode.php and PersoonNodeInterface.php file with some code.<br> Install the module.<br> Clear caches.<br> goto the home page.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <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