- Issue created by @devanbicher
- First commit to issue fork.
- Status changed to Needs review
5 months ago 9:45am 31 July 2024 - 🇮🇳India rajeshreeputra Pune
Patch looks good to me, not verified yet on local. Created MR for quick review and merge.
Because of differences in the implementation of
external entities →
compared to other fielded entity types the default behavior in src/EntityClone/Config/ConfigWithFieldEntityClone.php
cloned an external entity, but did not add any of the additional fields.
The primary discrepancy lies in the fact that different external entity types are not bundles of type external entity, but instead each external entity is it's own type. Meaning bundle and type are the same. So in ConfigWithFieldEntityClone, $cloned_entity->getEntityType()->getBundleOf()
returned null
.
As a result of this behavior, field definitions don't re-use field storage, so for each new external entity that is cloned the field storage definitions must be cloned along with the field definitions. Similarly view and form displays don't follow the same naming convention as other entities.
I've included a patch with a new class, ExternalEntityClone
that extends ConfigEntityCloneBase
.
It's a modified version of ConfigWithFieldEntityClone that will work with external entities.
Included in the patch is a modification of entity_clone_entity_type_build
in entity_cone.module to include an entry in $specific_handler
for the external_entity_type, which allows the new class to work with external entities.
This patch has already been tested with local instances of our current site and will likely be included on our stack soon.
Testing then merging into the module.
None
None. This patch and proposed follows the existing patterns and paradigms in this module.
None.
Needs review
2.0
Code
Patch looks good to me, not verified yet on local. Created MR for quick review and merge.