For our projects, we have maxSlugIncrement set to 1, which prevents URLs from being incremented:
test-page, test-page-1, test-page-2 etc.
This works absolutely fine, until we try and use Crafts "Save as a new entry" feature, which returns an error:

If we disable this config option, the page does duplicate as expected, and we can see the new URL it has generated:

It seems that this feature duplicates the entry and increments the new slug, however this would always fail if your config option was set to avoid duplicate URLs.
To get around this, what if entries were duplicated with an empty slug value? That way, if the author renamed the new entry and hit save, it would automatically generate a slug from that title. Otherwise, they could enter their own slug manually.
In both situations, saving the entry for the first time with an empty slug would run it through the normal URL validation, which would _then_ check if maxSlugIncrement is defined?
Tested on a fresh Craft install with maxSlugIncrement set to 1.
Entries are created inside a Structure, and Entry URI Format is set to {parent.uri ?? ''}/{slug}
I don’t think allowing empty slugs is the answer here, but perhaps we could stop validating that elements have a unique URI, if they are disabled. Combined with setting entries’ statuses to disabled by default when duplicating them (which may be more desirable).
Thanks Brandon. That sounds like a sensible approach to me, and does make a lot of sense in hindsight. If a user was working through a content entry process that involved duplicating an entry and then modifying it, they might not want the entry going live straight after duplication, before they have a chance the change the content.
This has been resolved for the next 3.4 release:
Craft 3.4.6 is out now with this change.
That works great, thanks for sorting.
Most helpful comment
Craft 3.4.6 is out now with this change.