Bugzilla – Attachment 110756 Details for
Bug 26537
Search does not work when no term in value_builder/unimarc_field_4XX.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26537: Fix search when no term in value_builder/unimarc_field_4XX.pl
Bug-26537-Fix-search-when-no-term-in-valuebuilderu.patch (text/plain), 2.05 KB, created by
Fridolin Somers
on 2020-09-25 13:22:25 UTC
(
hide
)
Description:
Bug 26537: Fix search when no term in value_builder/unimarc_field_4XX.pl
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-09-25 13:22:25 UTC
Size:
2.05 KB
patch
obsolete
>From 31b7e7405506ff78ae86eba6089a7451c0a83316 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 25 Sep 2020 15:15:38 +0200 >Subject: [PATCH] Bug 26537: Fix search when no term in > value_builder/unimarc_field_4XX.pl > >Cataloguing plugin value_builder/unimarc_field_4XX.pl has an itemtype filter. >It does not work when used without a search term. > >Test plan : >1) Be sure search on itemtype return some results >2) Use cataloguing plugin unimarc_field_4XX.pl >3) Enter no search term and select an itemtype >4) Check you get correct results >5) Enter a search term and dont select an itemtype >6) Check you get correct results >7) Enter a search term and select an itemtype >8) Check you get correct results >--- > cataloguing/value_builder/unimarc_field_4XX.pl | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl >index e15768780e..c9573cad8a 100755 >--- a/cataloguing/value_builder/unimarc_field_4XX.pl >+++ b/cataloguing/value_builder/unimarc_field_4XX.pl >@@ -357,11 +357,13 @@ sub plugin { > my $itype = $query->param('itype'); > my $startfrom = $query->param('startfrom'); > my $resultsperpage = $query->param('resultsperpage') || 20; >+ my $searchquery = ''; > my $orderby; >- my $op = 'and'; >- $search = 'kw:'.$search." $op mc-itemtype:".$itype if $itype; >+ $searchquery .= 'kw:'.$search if $search; >+ $searchquery .= ' AND ' if $search && $itype; >+ $searchquery .= 'mc-itemtype:'.$itype if $itype; > my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); >- my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat($search, $startfrom * $resultsperpage, $resultsperpage ); >+ my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat($searchquery, $startfrom * $resultsperpage, $resultsperpage ); > if (defined $errors ) { > $results = []; > } >-- >2.27.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 26537
:
110756
|
111049
|
128930
|
128931
|
128932
|
128933
|
128934
|
128937
|
128938
|
129607
|
129646
|
129647
|
144858
|
144859