Bugzilla – Attachment 152937 Details for
Bug 31253
Item search in staff interface should call barcodedecode if the search index is a barcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31253: Item search in staff interface should call barcodedecode if the search index is a barcode
Bug-31253-Item-search-in-staff-interface-should-ca.patch (text/plain), 1.89 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-07-03 12:52:08 UTC
(
hide
)
Description:
Bug 31253: Item search in staff interface should call barcodedecode if the search index is a barcode
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-07-03 12:52:08 UTC
Size:
1.89 KB
patch
obsolete
>From dfa49b686e447e5bbee3a5ffec5d01695bd63555 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Thu, 28 Jul 2022 09:13:09 -0400 >Subject: [PATCH] Bug 31253: Item search in staff interface should call > barcodedecode if the search index is a barcode > >We should run any inputted barcode through barcodedecode before passing it to any subroutines. >This was missed during the initial development of bug 26351. > >Test Plan: >1) Set itemBarcodeInputFilter to "Remove spaces from" >2) Create an item with the barcode "MYTEST" >3) Browse to the staff side advanced search >4) Run a barcode search for "MY TEST" >5) Note no results are round >6) Apply this patch >7) Restart all the things! >8) Repeat your search >9) Note the item was found! > >Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Edit: fixed typo in comment >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > catalogue/itemsearch.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 72074a8fdf8..fad7d1a8aee 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -22,6 +22,7 @@ use CGI; > use JSON qw( to_json ); > > use C4::Auth qw( get_template_and_user ); >+use C4::Circulation qw( barcodedecode ); > use C4::Output qw( output_with_http_headers output_html_with_http_headers ); > use C4::Items qw( SearchItems ); > use C4::Koha qw( GetAuthorisedValues ); >@@ -50,6 +51,12 @@ if (defined $format and $format eq 'json') { > > my @f = $cgi->multi_param('f'); > my @q = $cgi->multi_param('q'); >+ >+ # If index indicates the value is a barcode, we need to preproccess it before searching >+ for ( my $i = 0; $i < @q; $i++ ) { >+ $q[$i] = barcodedecode($q[$i]) if $f[$i] eq 'barcode'; >+ } >+ > push @q, '' if @q == 0; > my @op = $cgi->multi_param('op'); > my @c = $cgi->multi_param('c'); >-- >2.41.0
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 31253
:
138205
|
152909
| 152937