Skip to content

Bring "Duplicate" actions into Core#6307

Merged
jasonvarga merged 36 commits intostatamic:3.3from
duncanmcclean:duplicator-actions
Nov 29, 2022
Merged

Bring "Duplicate" actions into Core#6307
jasonvarga merged 36 commits intostatamic:3.3from
duncanmcclean:duplicator-actions

Conversation

@duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Jul 6, 2022

This pull request brings the various "Duplicate" actions into Statamic Core, out of my Duplicator addon.

The Duplicator addon is currently the most popular addon on the Statamic Marketplace (which proves its an already popular feature). Also, pretty much any time I mention my Duplicator addon on Twitter, folks always say it should be something that's part of Core. In addition to that, there's an open FR with a small number of 👍 (statamic/ideas#118)

Obviously, let me know if there's anything you'd like me to explain in the code and/or change.

Closes statamic/ideas#118

Copy link
Contributor

@andjsch andjsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the wrong german translation

@what-the-diff
Copy link

what-the-diff bot commented Nov 2, 2022

  • Added a new action to duplicate entries, terms and assets.
  • Added the ability for fields to be duplicated or not when an item is duplicated (duplicate: true/false).
  • Fixed some translation issues in German, French and Dutch translations of Statamic core strings.
  • Added a new field to the blueprint for fields.
  • Registered some actions in the service provider that were missing from it before (duplicate asset, entry, form and term).
  • Created a validation rule for unique form handles so we can use them as slugs when duplicating forms without having to worry about collisions with existing ones or other rules like slug uniqueness etc...
  • Wrote tests for all of these things! :)

@jasonvarga
Copy link
Member

jasonvarga commented Nov 22, 2022

I'm in the middle of making some changes to this.

Part of it being brought into core means you get to deal with our opinions! 😄

The dedicated config file felt a bit out of place. It made sense for an addon, but now that it's in core, we felt things could be tweaked a little.

  • Instead of the option to fingerprint, a duplicated_from: id-of-thing will always be saved to the item.
  • Instead of the option to configure whether entries should be published, they will always be drafts.
  • Instead of configuring ignored fields, you now do it on the field in your blueprint by adding duplicate: false.

Then a bunch of other little nitpicks and fixes not really worth mentioning.

@andjsch
Copy link
Contributor

andjsch commented Nov 23, 2022

Question as you are working on it. Why will it not be possible for multisites to duplicate entries?

@jasonvarga
Copy link
Member

jasonvarga commented Nov 23, 2022

I'm disabling the ability to duplicate entries when you use multi-site, temporarily.

The existing functionality was a bit ambiguous and to some people it may not work like you'd expect (myself included).
e.g. duncanmcclean/duplicator#41 - the person who asked for the feature.

Gotta figure out how to handle the different scenarios. Like....

  • If you duplicate an entry that has localizations, should they also get duplicated?
  • If the entry wasn't localized into all sites, should the new entry get localized into all sites, or only the ones the original was localized into?
  • If you duplicate a localized entry, what do you do with its origin?
  • What if you just wanted to just localize an entry into another site, you might think the duplicate action would do that.

Disabling for multisite will at least let this feature get merged so you can start using it, and we can figure out multisite later.

@jasonvarga jasonvarga merged commit edcfd2d into statamic:3.3 Nov 29, 2022
@duncanmcclean
Copy link
Member Author

Thanks for your changes on this PR @jasonvarga!

Time to archive my addon 🙂

@Sennik
Copy link

Sennik commented Feb 10, 2023

I was missing the duplicate function in my multi site setup, looked around for an hour or so until I found this issue.

I must say I feel sincerely crippled by this 'temporarily' situation. Isn't it possible to re-add it with a config key so we have to read and accept the limitations before switching it on again?

@afonic
Copy link

afonic commented Feb 17, 2023

@Sennik just install the Duplicator addon again, it still works.

If you want my two cents, the approach @duncanmcclean already has is fine, it just asks you in which Sites you want to duplicate an entry. Simple and clear enough, at least for 3-4 not so technical users we have.

@Sennik
Copy link

Sennik commented Feb 17, 2023

@Sennik just install the Duplicator addon again, it still works.

If you want my two cents, the approach @duncanmcclean already has is fine, it just asks you in which Sites you want to duplicate an entry. Simple and clear enough, at least for 3-4 not so technical users we have.

I already did and I am happy ;-)

@jasonvarga has his points though. So for now I will be careful using it until the full fledged version is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate entry

5 participants