Summary: | Leading spaces in barcode should not allowed in cataloguing | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Cataloging | Assignee: | Jérémy Breuillard <jeremy.breuillard> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | david, jonathan.druart, josef.moravec, julian.maurice, m.de.rooy, severine.queune |
Version: | 21.05 | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1626 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29114 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30409 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 22204: Remove whitespaces in barcode before saving
Bug 22204: use barcodedecode from C4/Circulation in additem.pl [21.05] Bug 22204: Use barcodedecode in additem.pl |
Description
Fridolin Somers
2019-01-24 16:48:37 UTC
Hi Frido, do you plan to provide a patch? (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. Created attachment 126266 [details] [review] 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> Please have a look at: C4/Circulation.pm: barcodedecode Please enter assignee too :) BTW : should the trim be in Koha::Items->store() ? Created attachment 126344 [details] [review] Bug 22204: use barcodedecode from C4/Circulation in additem.pl 194 $item->barcode(barcodedecode($item->barcode)); Is this patch really needed? Did you try itemBarcodeInputFilter=whitespace? (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) (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 ?? :) Bug tested on master branch. It works correctly. 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 Created attachment 126430 [details] [review] [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> 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 *** This bug has been marked as a duplicate of bug 30409 *** |