[Feature]: "Copy to a new entry" from an item's detail page
Before suggesting
- [x] I searched the existing issues and did not find a similar request.
What problem would this solve?
Owning the same work in more than one form is common (a film on Blu-ray and 4K, a book in two editions). Adding the second copy today means re-entering everything by hand, even though it differs from the first by only a field or two (usually the format).
How could it work?
A "Copy to a new entry" button on the detail page that opens the add/confirm form pre-filled from the current item, minus its own identity, so it saves as a brand-new document through the normal create path. An optional target (e.g. ?format=) can be preselected so the "already in collection" banner reacts immediately.
Kept generic via an optional getCopyDefaults(item) hook on the plugin definition: the plugin decides which fields to seed and which to drop (typically the source verbatim minus its id and minus whatever distinguishes the new entry). Plugins that do not declare it simply do not show the button. The seeded form reuses the existing duplicate-warning banner (via the plugin's getVariants) so copying into a format already owned is flagged.
The button is not offered for a contained item (a TV season) or a holder, since those are added through their own flow.
Note: this depends on a small confirm-form fix I have opened separately as PR #171 — a pre-seeded custom field would otherwise be posted twice and fail to save. The copy flow is what surfaced that bug, but the fix stands on its own.
Alternatives you considered
A bulk "add N formats" dialog (more complex, less flexible) or duplicating in the DB (not user-facing). Seeding a normal add form keeps the usual validation, cover handling and duplicate warning with no new save path.
Would you like to help build it?
I could open a PR for it
Hey! Thank you, this would save a lot of typing ;) Go for it!
I'd just skip the per-plugin hook so the button shows up for every type, custom ones included. The copy can strip the identity and the barcode generically, with an optional list of extra fields a plugin wants dropped (the Discogs release id for music, say). The duplicate banner already knows which fields tell two copies apart, so it lights up on its own until the format is changed, no need for ?format=.
Your confirm fix already shipped in 3.2.0, so nothing blocks it. Thanks for all the careful reports lately <3
Hi! I just released version 3.3.0, which includes your copy feature :D
Thanks again for the careful report and all the feedback rounds!