strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.

Home Page:https://market.strapi.io/plugins/strapi-plugin-slugify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: counter doesn't refresh during modification

AllanCLRS opened this issue · comments

Reproduce :

  • new entry with title "apple" => slug autogenerated as "apple"
  • modif title with "apples" => slug autogenerated as "apples"
  • modif title with "apple" => slug autogenerated as "apple-1"

However it's working if it's in a new entry

Can we slugify.refresh() to solve this pb ?

my config:

slugify: {
    enabled: true,
    config: {
      shouldUpdateSlug: true,
      slugifyWithCount: true,
      slugifyReset: true,
      contentTypes: {
        formation: {
          field: 'Url',
          references: 'Titre',
        },
      },
    },
  },

I am not sure I understand the issue. Do you mean you expect the counter not to increment when you change the slug back and forth on the same record?

I am not sure I understand the issue. Do you mean you expect the counter not to increment when you change the slug back and forth on the same record?

Yes

I do not see this as an expected behaviour. If you have used the slug previously whether it was for the same record or not it cannot be used again (and therefore the counter is incremented).

I will convert this to a discussion and see what the feedback is, if enough interest for this behaviour then I will look into it.