- πΊπΈUnited States SocialNicheGuru
I want to create a list of the current replicants.
Could I use this to set an entity reference to all the clones of the current entity?
- last update
over 1 year ago 7 pass
A typical workflow for manual Replication through the user interface follows the pattern:
Currently, modules supplying overrides for #2 have to implement a form alter hook and a submit hook to apply the overrides to the replicated entity. This implementation could become more OO and testable if the overrides could be applied through the Replicate events as arbitrary properties, similar to the current implementation in Entity Clone:
/**
* Constructs an EntityCloneEvent object.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The original entity that was cloned.
* @param \Drupal\Core\Entity\EntityInterface $cloned_entity
* The clone of the original entity.
* @param array $properties
* The entity's properties.
*/
public function __construct(EntityInterface $entity, EntityInterface $cloned_entity, array $properties = []) {
$this->entity = $entity;
$this->clonedEntity = $cloned_entity;
$this->properties = $properties;
}
See \Drupal\entity_clone\Event\EntityCloneEvent
Allow passing arbitrary properties to the Replicate events
None.
To be determined.
To be determined.
Needs review
1.0
Code
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I want to create a list of the current replicants.
Could I use this to set an entity reference to all the clones of the current entity?