localgovdrupal / localgov

Installation profile for the LocalGov Drupal distribution.
GNU General Public License v2.0
83 stars 18 forks source link

Add 'Entity Clone' or 'Replicate' to core #693

Open willguv opened 6 months ago

willguv commented 6 months ago

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)

willguv commented 4 months ago

I'll try doing this with my new gitpod set up

markconroy commented 4 months ago

@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.

willguv commented 4 months ago

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?

markconroy commented 4 months ago

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

  1. What content types should be replicatable?
  2. 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?

markconroy commented 4 months ago

@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

dedavidson commented 4 months ago

We used Entity Clone on D&G

willguv commented 4 months ago

Was there a reason you picked Entity Clone over Replicate @dedavidson? Thanks

dedavidson commented 4 months ago

@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.

willguv commented 4 months ago

@dedavidson @markconroy I've just installed Entity Clone and think it might be a better bet

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

markconroy commented 4 months ago

I've no problem with us using Entity Clone module.

willguv commented 4 months ago

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?

ekes commented 4 months ago

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.

willguv commented 4 months ago

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?

andybroomfield commented 4 months ago

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.

ekes commented 4 months ago

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?

willguv commented 4 months ago

Andy: Issue with paragraphs and Entity Clone Ryan: Have to republish paragraphs with Entity Clone PaulB: Entity Clone issues with Subsites

willguv commented 4 months ago

Finn: Write specific use cases

andybroomfield commented 2 months ago

BHCC has gone with Replicate and we've writen a module I could share to replicate whole books.

willguv commented 1 month ago

Haringey went with Replicate, also used in LGD microsites

Starshot went with Quck Node Clone

markconroy commented 3 weeks ago

What is the first content type to tackle with this? Do councils want to replicate Service Landing Pages or Subsite Overview pages or something else? Let's choose one, get it done, and then use that as the basis for extending it to more content types.

willguv commented 3 weeks ago

Hi Mark, Event has been mentioned - it's very common for an event to have almost all the same details, maybe just a time or date. This obviously needs to work with current version of events and the new work @joachim-n is doing

If you'd sooner another example to start with I'll have a think

markconroy commented 2 weeks ago

Started here: https://github.com/localgovdrupal/localgov_replicate

Working for all content types, but need to figure out better access checks, so only content types that are set to be replicatable show the replicate tab.


Thanks to Big Blue Door for sponsoring my time to work on this.

markconroy commented 2 weeks ago

Screenshot 2024-10-08 at 13 32 16