[Bug 22204] New: Leading spaces in barcode should not allowed in cataloguing
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Bug ID: 22204 Summary: Leading spaces in barcode should not allowed in cataloguing Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- When creating a new item, it is not allowed to add trailing spaces, it shows 'Barcode must be unique'. But it is allowed to use leading spaces :( In this case since circulation does a trim on barcode this item can not be checked-out. It also allows duplicates even with UNIQUE KEY constraint. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=1626 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Séverine Queune <severine.queune@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |severine.queune@bulac.fr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hi Frido, do you plan to provide a patch? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #2 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- (In reply to Jonathan Druart from comment #1)
Hi Frido, do you plan to provide a patch?
I'm not sure when I can find time, feel free to propose patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|fridolin.somers@biblibre.co |koha-bugs@lists.koha-commun |m |ity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 126266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126266&action=edit Bug 22204: Remove whitespaces in barcode before saving Test plan: 1. Create an item with barcode "1" 2. Try to create an item with barcode " 1 " and verify that it is blocked 3. Create an item with barcode " XXXXX " and verify that it is saved without spaces in database: SELECT barcode FROM items WHERE barcode LIKE '%XXXXX%' Co-authored-by: Jérémy Breuillard <jeremy.breuillard@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Please have a look at: C4/Circulation.pm: barcodedecode -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Please enter assignee too :) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29114 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |julian.maurice@biblibre.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- BTW : should the trim be in Koha::Items->store() ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|julian.maurice@biblibre.com |jeremy.breuillard@biblibre. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #7 from Jérémy Breuillard <jeremy.breuillard@biblibre.com> --- Created attachment 126344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126344&action=edit Bug 22204: use barcodedecode from C4/Circulation in additem.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Jérémy Breuillard <jeremy.breuillard@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- 194 $item->barcode(barcodedecode($item->barcode)); Is this patch really needed? Did you try itemBarcodeInputFilter=whitespace? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #8)
194 $item->barcode(barcodedecode($item->barcode));
Is this patch really needed?
Did you try itemBarcodeInputFilter=whitespace?
It looks like we worked on an out-of-date master branch... (this line was added 10 days ago). We must try to reproduce the bug on master (bug 26351) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Julian Maurice from comment #9)
(In reply to Jonathan Druart from comment #8)
194 $item->barcode(barcodedecode($item->barcode));
Is this patch really needed?
Did you try itemBarcodeInputFilter=whitespace?
It looks like we worked on an out-of-date master branch... (this line was added 10 days ago).
We must try to reproduce the bug on master (bug 26351)
"(bug 26351)" was added on the wrong line. It's the bug that was pushed 10 days ago. Why can't we edit comments ?? :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 --- Comment #11 from Jérémy Breuillard <jeremy.breuillard@biblibre.com> --- Bug tested on master branch. It works correctly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|master |21.05 --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Problem still exists in 21.05 and lower versions. The attached patches should work correctly on those versions. I will squash them for an easier review -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #126266|0 |1 is obsolete| | Attachment #126344|0 |1 is obsolete| | --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 126430 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126430&action=edit [21.05] Bug 22204: Use barcodedecode in additem.pl Test plan: 1. Set syspref itemBarcodeInputFilter to 'whitespace' 2. Create an item with barcode "1" 3. Try to create an item with barcode " 1 " and verify that it is blocked 4. Create an item with barcode " XXXXX " and verify that it is saved without spaces in database: SELECT barcode FROM items WHERE barcode LIKE '%XXXXX%' Co-authored-by: Jérémy Breuillard <jeremy.breuillard@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |david@davidnind.com --- Comment #14 from David Nind <david@davidnind.com> --- Patch no longer applies 8-(... (using koha-testing-docker and 21.05): 126430 - [21.05] Bug 22204: Use barcodedecode in additem.pl Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 22204: Use barcodedecode in additem.pl Using index info to reconstruct a base tree... M cataloguing/additem.pl Falling back to patching base and 3-way merge... Auto-merging cataloguing/additem.pl CONFLICT (content): Merge conflict in cataloguing/additem.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 22204: Use barcodedecode in additem.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30409 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22204 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|Patch doesn't apply |RESOLVED --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- *** This bug has been marked as a duplicate of bug 30409 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org