]> git.koha-community.org Git - koha.git/commit
Bug 30409: barcodedecode() should always trim barcode
authorPetro Vashchuk <stalkernoid@gmail.com>
Sat, 2 Apr 2022 21:02:40 +0000 (00:02 +0300)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 13 Jul 2022 19:44:18 +0000 (19:44 +0000)
commit391cb02d456d3e764c00bdd89e098f27f05246f0
treeaf99c881cbc856e6967800ef71d033a2ea8a0d9f
parentc535da7219710a262f63e4af7883e060b0429ca5
Bug 30409: barcodedecode() should always trim barcode

Barcode is trimmed of leading/trailing whitespaces in many instances
before the barcodedecode sub was called. This patch instead makes that
barcodedecode sub is going to trim it itself and removes unnecessary,
and repetitive code that was used before barcodedecode was called.

Steps to test:
1. Edit item with any barcode, add a bunch of whitespaces at the start
and at the bottom of it. Save the item. Ensure that this action ruins
the barcode and ensure that the spaces are still there by editing the
same item again.
2. Apply the patch.
3. Edit the same item again in the same fashion. Ensure that now all
whitespaces are getting trimmed and it doesn't affect the barcode in
any negative way.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2611c919dd5287402b89f219d75d3a013407123)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Circulation.pm
circ/branchtransfers.pl
circ/circulation.pl
circ/renew.pl
circ/returns.pl
course_reserves/add_items.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
t/Circulation_barcodedecode.t