saleor
saleor copied to clipboard
Bug: Should not be possible to create an empty slug of attributeValue
What are you trying to achieve?
Create multiple select attribute with some values, then on product details page try to add new value as "!@" and "@!". Got to attribute details page view and check slug on added new values.
Steps to reproduce the problem
- Create multiple select attribute and assign it to some productType.
- Edit a product which is created from edited productType.
- Add new values on multiple select attribute - e.g. "!@" and "@!"
- Save it.
- Edit created attribute - one of added values has an empty slug, second one is "-2"
What did you expect to happen?
We should not create a new value with empty slug.
Logs

https://user-images.githubusercontent.com/29308910/196435792-3503afaf-93e3-4b87-b780-b0f4f0d23b89.mp4
Environment
Saleor version: 3.1 and higher
The proposition is to use a dash followed by numbers for cases when the slugify returns the empty string.