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

feat: counter doesn't refresh during modification #91

Closed AllanCLRS closed 1 year ago

AllanCLRS commented 1 year ago

Reproduce :

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',
        },
      },
    },
  },
ComfortablyCoding commented 1 year ago

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?

AllanCLRS commented 1 year ago

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

ComfortablyCoding commented 1 year ago

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.