Description
Hello there,
thanks for this awesome bundle. I implemented in a recent project and I am most pleased :-)
I experienced one UX issue while editing some content: I entered a couple of tags to a dataset from a list my client gave me. I did not realize the list contained some duplicates.
What happened
-
Enter
Chai
=> Tag does not exist yet => AddChai
=>Chai
is added to the tags list -
Continue enter plenty more tags.
-
Save in between.
-
Enter
Chai
again => Tag is already in list and does exist in Database, but selectize.js does not check that -> AddChai
->Chai
is added to the tags list. -
Chai
is added two times now -
On submit, an SQL error will be thrown: When the bundle tries to add the second
Chai
, the first one is already stored in the database:
An exception occurred while executing 'INSERT INTO tl_cfg_tag (`tstamp`, `name`, `source`) VALUES (1554295030, 'Chai', 'app.trader_tags')':
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Chai-app.trader_tags' for key 'name_source'
This is quite annoying from an UX perspective.
What should happen
- I would expect a duplicate check whether the given term was already entered before
- I would than expect a message like "Tag already in list"
What do you think? I could provide a PR.
Cheerio
EDIT: I edited this issue to be more precisely: If a term is not saved yet, you cannot add it twice to the tags list. Selectize.js takes care of that. However, if you saved once, you can easily add an already added and saved tag multiple times, causing the SQL Expection.