- Issue created by @solimanharkas
- Merge request !23Issue #3514391 by solimanharkas: Fix: Prevent InvalidArgumentException when... → (Open) created by solimanharkas
When attempting to create a translation (specifically an English translation) for content that uses Layout Builder, the process fails with the following error:
InvalidArgumentException: The specified translation (en) cannot be removed. in Drupal\Core\Entity\ContentEntityBase->removeTranslation() (line 1023 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
This error occurs in the Layout Builder Asymmetric Translation (layout_builder_at) module when it attempts to remove a translation that cannot be removed - typically the default language translation during the block replication process.
Modify the LayoutBuilderCopyWidget->extractFormValues() method to gracefully handle cases where a translation cannot be removed:
This ensures the translation process can continue without errors while maintaining the core functionality of the module.
Active
3.0
Code