Part Variation Cloner and Replicate UI

Some parts have redundant values, so I want to be able to clone them for quicker data entry.

I am thinking of a "Clone" tab that opens an edit form with the values duplicated. Some field values should not be copied (ones that differ the variation).

First I tried Cloner, which provides a plugin API for custom entity clone behavior. I coped and modified files from the Cloner Examples module and set them up for my Part variation entities (built with ECK).

The sample code alters the entity edit form and adds a clone button, which copies and displays the new entity. I can customize how the entity is cloned in the submit function. To get this to do what I want, I could try setting up an entity edit form and loading the values without saving. But I would have to write a bit more code.

Replicate UI is a module that can quickly add a "Replicate" tab for any entity tab. This opens a form to set the new title, and copies the entity, showing you the view page. Replicate Actions module will override this, saving the copied entity as unpublished and displaying the edit form.

Project
Tags