Problem/Motivation
We needed to use the module in combination with Group 2.x (2.3.2 at this time). As far as this module is concerned, the difference between Group 2.x and 3.x is very minor: with Group 2.x in ReplicateNodeToGroup::addToGroups(), there will be no entity type "group_relationship", but "group_content" will exist.
Steps to reproduce
- begin with a site running Group 2.x
- install Replicate, Replicate UI, and Replicate Actions
- update Replicate's config to allow the Group entity type to be cloned
- attempt to replicate a Group entity
Results
- there won't be a "Replicate" link in the tabs region
- hacking the edit url to include
/replicateresults in the error
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "group_relationship" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Proposed resolution
The very simple fix I arrived at was just to check the for a known group entity type using $this->entityTypeManager->hasDefinition(). Using that, we can set a variable for the module's $this->entityManager->getStorage() call to use an entity name appropriate to the running version of Group.
Risks
The main risk of this approach is supporting Group 2: if Group 3 continues to diverge in significant ways that Replicate Actions needs to adapt to, my simple-minded fix might need to be turned into a lot of other fixes or some sort of compatibility layer.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | replicate_actions-group-2x-compatibility-3566684-1.patch | 1.05 KB | bedlam |
Comments
Comment #2
bedlamPatch attached.
Comment #3
ruslan piskarovThank you, @bedlam. LGTM.
Comment #5
ruslan piskarov