Add 'Entity Clone' or 'Replicate' to core
We need to try installing https://www.drupal.org/project/replicate on LGD
(@markconroy has already got it working on Microsites in Essex and will push back to us)
I'll try doing this with my new gitpod set up
@willguv let's get a definition of what we want to do with replicate module. Installing it will do nothing, as it's just an API module. You need code then to use that API to achieve what we want.
I'm guessing we want to be able to clone all/some content types, and/or only certain users can use the clone functionality.
Aha! I installed it and there was no visible change - that explains it
@dedavidson has done Replicate work for Dumfries. What did you do there please Duncan?
If we get a list of what we want (or even some of what we want), I'll try spend time on this next week.
Maybe a generic approach with a settings form to say
- What content types should be replicatable?
- What user roles should be allowed to use replicate?
Then ... it would be up to each council to decide what way the want to use the module?
@willguv try installing the replicate_ui module and that should give you access to click some options for what you want.
https://www.drupal.org/project/replicate_ui
We used Entity Clone on D&G
Was there a reason you picked Entity Clone over Replicate @dedavidson? Thanks
@willguv nothing in particular except Replicate hasn't been updated in over a year and Entity Clone has more than double the sites using it.
@dedavidson @markconroy I've just installed Entity Clone and think it might be a better bet
- it largely works out of the box (just needs permissions to be set)
- for the reasons Duncan mentioned about usage and updates
What do you think please?
I'm not a fan of the word "Clone" if I'm honest. We can discuss changing it if we go this route
I've no problem with us using Entity Clone module.
Thanks @markconroy let's go for it then!
Ideally Entity Clone should be added to core and enabled by default
Is there a way to change the word 'Clone' on the button to something else?
We use replicate in microsites. Is there really a reason to have two modules that do the same thing in LGD? We also have had this discussion on an issue somewhere else I think? Ah! Here https://github.com/localgovdrupal/localgov_events/issues/96 The reason for replicate is that it can be controlled and configured by the developers to remove complexity, you can configure custom cloning (making sure the correct referenced entities are cloned etc.). Entity clone can't be used programatically. So one works both ways, the other not.
OK that's interesting, thanks @ekes. We shouldn't have two modules doing the same thing
What do we need to use Replicate - a list of entities we would like it to be able to clone?
I thought I posted on another issue, my question is what criteria would we prefer one over the other? Does paragraphs get cloned correctly with entity clone. Currently I'm building a replicate book feature for a BHCC section and possible expansion to publications with Replicate, is there an API to do that with entitiy clone as I wouldn't want to have duplicate modules.
is there an API to do that with entitiy clone
No. It's UI, or specifically, form driven. Which is why we used replicate in Microsites. Where as with replicate, it is API first, but you can install, or build, a UI for it.
What do we need to use Replicate - a list of entities we would like it to be able to clone?
Yes, assuming the replicate UI module isn't up to the job... it's not something I've used.
What seems best is: Make a list of entities you want a 'clone' (or whatever) tab on; and decide by default which entity reference fields you also want duplicated, and which want to reference the existing entity. Generally I think this will be most 'text' paragraphs want duplicating, but stuff like media or geo want to reference the same entity. There might be other things for specific fields that help usability, like do you want to replicate the event into a form with the date empty?
Andy: Issue with paragraphs and Entity Clone Ryan: Have to republish paragraphs with Entity Clone PaulB: Entity Clone issues with Subsites
Finn: Write specific use cases
BHCC has gone with Replicate and we've writen a module I could share to replicate whole books.