strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.
https://market.strapi.io/plugins/strapi-plugin-slugify
MIT License
45 stars 21 forks source link

Duplicate button on the collection list item causes slugify to disallow duplication feature #85

Closed oDinZu closed 1 year ago

oDinZu commented 2 years ago

I was using an unofficial duplicate button, but it seems that Strapi has its own duplicate feature baked into the code now.

After uninstalling the duplicate plugin, I noticed the duplicate button for the list collection item.

Screenshot from 2022-11-25 13-53-55

I added the slugifyWithCount option to see if it would at least create a new slug if has the same slug, but that resulted in the same error as shown above.

This is the URL that is used when "cloning" a collection type.

https://example.com/admin/content-manager/collectionType/api::post.post/create/clone/2?plugins[i18n][locale]=en

In reference to unofficial plugin: https://github.com/lautr/strapi-plugin-duplicate-button/issues/7#issuecomment-1327801093

ComfortablyCoding commented 1 year ago

I see the problem but not sure if its fixable from my perspective as the cloning is done completely on the frontend. The slugifcation done by this plugin relies on the model lifecycles to run but for cloning they do not.

I would recommend filing an issue on the strapi repo and see what the say for the slug field (which is supposed to be unique) giving an error when attempting to clone and save with no change.