Bugzilla – Attachment 91817 Details for
Bug 22799
Batch item modification is case sensitive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22799: Avoiding batch item modification case sensitivity when entering barcodes
Bug-22799-Avoiding-batch-item-modification-case-se.patch (text/plain), 3.05 KB, created by
Kyle M Hall (khall)
on 2019-07-26 15:05:37 UTC
(
hide
)
Description:
Bug 22799: Avoiding batch item modification case sensitivity when entering barcodes
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-07-26 15:05:37 UTC
Size:
3.05 KB
patch
obsolete
>From db55aff2e11495d9a0dcd8a9b173e9b0cb1ef39b Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 29 Apr 2019 01:25:46 +0000 >Subject: [PATCH] Bug 22799: Avoiding batch item modification case sensitivity > when entering barcodes > >Note: this fixes the bug that is present right now where batch item >modification barcode matching is case sensitive, but if Koha barcodes >ever do become case sensitive, this patch will need to be removed. > >To test: >1) Make/use an item with a barcode with letters in it. For testing >purposes, I'll be using an item with the barcode 'abcde'. >2) Go to Tools -> Batch item modification and enter this barcode in the >barcode list text input field, but change the case of one or some >letters. (i.e. enter the barcode in the field as 'abCDE') >3) Click Continue >4) Notice that the next page shows an error 'the following barcodes were >not found', but the item still shows underneath (was correctly fetched from database). >5) Create a text file and put the changed-case barcode in it (i.e. put >the barcode 'abCDE' in the text file) >6) Go back to batch item modification and upload the >text file as a barcode file >7) Notice same error as in Step 4 >8) Apply patch and refresh page >9) Run through steps 1 to 6. There should no longer be an error and the >barcodes should be found as expected. > >Sponsored-by: South Taranaki District Council >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> > >Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> > >Signed-off-by: Donna Bachowski <donna@bywatersolutions.com> >--- > tools/batchMod.pl | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 2296ecdc60..9b1f958950 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -256,7 +256,11 @@ if ($op eq "show"){ > if ($filecontent eq 'barcode_file') { > my $existing_items = Koha::Items->search({ barcode => \@contentlist }); > @itemnumbers = $existing_items->get_column('itemnumber'); >- my %exists = map {$_=>1} $existing_items->get_column('barcode'); >+ my %exists = map {lc($_)=>1} $existing_items->get_column('barcode'); >+ # to avoid problems with case sensitivity >+ foreach my $barcode (@contentlist) { >+ $barcode = lc($barcode); >+ } > @notfoundbarcodes = grep { !$exists{$_} } @contentlist; > } > elsif ( $filecontent eq 'itemid_file') { >@@ -277,7 +281,11 @@ if ($op eq "show"){ > my $existing_items = Koha::Items->search({ barcode => \@barcodelist }); > @itemnumbers = $existing_items->get_column('itemnumber'); > my @barcodes = $existing_items->get_column('barcode'); >- my %exists = map {$_=>1} @barcodes; >+ my %exists = map {lc($_)=>1} @barcodes; >+ # to avoid problems with case sensitivity >+ foreach my $barcode (@barcodelist) { >+ $barcode = lc($barcode); >+ } > @notfoundbarcodes = grep { !$exists{$_} } @barcodelist; > } > } >-- >2.20.1 (Apple Git-117)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22799
:
88991
|
88994
|
89324
|
91763
|
91816
|
91817
|
92260