Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeUniqueCounterSlug stops at the 10th element #16

Open
nader-zouaoui opened this issue Sep 3, 2021 · 1 comment
Open

makeUniqueCounterSlug stops at the 10th element #16

nader-zouaoui opened this issue Sep 3, 2021 · 1 comment

Comments

@nader-zouaoui
Copy link

Hello,

Thanks for this nice plugin, it's amazing.

Although I just stumbled upon an issue when trying to make over 10 duplicates of the same slug while maintaining the uniqueness of each one.
I used the following setup for my feild :
slug: { type: String, require: true, unique: true, slug: 'name', slug_padding_size: 0, },
after digging a little in the code, I found that you extract the latest document using a sort of the slugified field, and then it all made sense.
the order of slug-something-9 is higher than slug-something-10 hence it always returns the item number nine.

I recommend chaining this option behind the find one:
image

@nader-zouaoui
Copy link
Author

#17 this should fix it

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

No branches or pull requests

1 participant