Bugzilla – Attachment 140604 Details for
Bug 31252
Advanced 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 31252: Advanced search in staff interface should call barcodedecode if the search index is a barcode
Bug-31252-Advanced-search-in-staff-interface-shoul.patch (text/plain), 1.97 KB, created by
David Nind
on 2022-09-13 19:20:10 UTC
(
hide
)
Description:
Bug 31252: Advanced search in staff interface should call barcodedecode if the search index is a barcode
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-09-13 19:20:10 UTC
Size:
1.97 KB
patch
obsolete
>From 94db8e648682316d425538ddf912de09d0fecfff Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Thu, 28 Jul 2022 08:35:33 -0400 >Subject: [PATCH] Bug 31252: Advanced 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) Browse to the staff side advanced search >3) Run a barcode search for "MY TEST" >4) Note the message returned is: > No results match your search for 'bc,wrdl: "MY TEST"'. >5) Apply this patch >6) Restart all the things! >7) Repeat your search >8) Note the message returned is: > No results match your search for 'bc,wrdl: "MYTEST"'. >9) Note the lack of the space between MY and TEST! > >Signed-off-by: David Nind <david@davidnind.com> >--- > catalogue/search.pl | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 0bb34b10d6..ad2537471f 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -141,6 +141,7 @@ use Modern::Perl; > ## load Koha modules > use C4::Context; > use C4::Output qw( output_html_with_http_headers pagination_bar ); >+use C4::Circulation qw( barcodedecode ); > use C4::Auth qw( get_template_and_user ); > use C4::Search qw( searchResults enabled_staff_search_views z3950_search_args new_record_from_zebra ); > use C4::Languages qw( getlanguage getLanguages ); >@@ -446,6 +447,11 @@ my $builder = Koha::SearchEngine::QueryBuilder->new( > my $searcher = Koha::SearchEngine::Search->new( > { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); > >+# If index indicates the value is a barocode, we need to preproccess it before searching >+for ( my $i = 0; $i < @operands; $i++ ) { >+ $operands[$i] = barcodedecode($operands[$i]) if $indexes[$i] eq 'bc'; >+} >+ > ## I. BUILD THE QUERY > ( > $error, $query, $simple_query, $query_cgi, >-- >2.30.2
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 31252
:
138202
|
140604
|
141498