Spurious duplicate barcode warning when editing book

DiscussionsBug Collectors

Rejoignez LibraryThing pour poster.

Spurious duplicate barcode warning when editing book

1ltji_test
Modifié : Mar 7, 2021, 1:02 am

Steps to reproduce:
1. Create a book with a unique barcode
2. Edit the book
3. Select the barcode field without changing it
4. Click outside of the text field so it loses focus, triggering a barcode check

Expected behavior:
* No warning is displayed

Actual behavior:
* Warning message appears stating that the barcode is already in use by the book itself

The client-side javascript code sends the book id as part of the request payload to ajax_barcode_checkiffree.php. The server should take this into account and ignore matches for the same book id.

Testing note:
The warning functionality can also be tested by logging in to LibraryThing and visiting https://www.librarything.com/ajax_barcode_checkiffree.php with query string ?book=<book id>&theitem=1&value=<barcode value>