- Issue created by @atowl
When translating a page, the Layout builder copy widget throws an error
AssertionError: Cannot load the "paragraph" entity with NULL ID. in assert() (line 262 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
The reason when we drilled down on this, was that the hook entity_duplicate (introduced via https://www.drupal.org/project/paragraphs/issues/3495373 📌 Support duplicate hook Active ), the $duplicate->getFields() modifies the duplicate passed into it, and adds all the fields from fieldDefinition to itself.
Using the module Layout Builder Asymmetric Translation, create a page with blocks in it, specifically a paragraph block
Add new translation.
error occurs.
Instead of iterating over getFields(), instead, iterate over fieldDefinitions().
Review patch.