Skip to content

Check for duplicates before submitting data in backend #17

Open
@bezin

Description

@bezin

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 => Add Chai =>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 -> Add Chai -> 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions