Bugzilla – Attachment 161236 Details for
Bug 35578
Validate "Where" in OPAC Authority search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35578: Simplify the code using intersect
Bug-35578-Simplify-the-code-using-intersect.patch (text/plain), 1.64 KB, created by
Martin Renvoize (ashimema)
on 2024-01-22 12:40:12 UTC
(
hide
)
Description:
Bug 35578: Simplify the code using intersect
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-22 12:40:12 UTC
Size:
1.64 KB
patch
obsolete
>From e703d7d9ae461198e659c97b83a43bb5e74e6530 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Jan 2024 16:54:49 +0100 >Subject: [PATCH] Bug 35578: Simplify the code using intersect > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > opac/opac-authorities-home.pl | 20 ++++++-------------- > 1 file changed, 6 insertions(+), 14 deletions(-) > >diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl >index ba011bd014e..9e617485d2f 100755 >--- a/opac/opac-authorities-home.pl >+++ b/opac/opac-authorities-home.pl >@@ -21,6 +21,8 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use URI::Escape qw( uri_escape_utf8 ); >+use Array::Utils qw(intersect); >+ > use C4::Auth qw( get_template_and_user ); > > use C4::Context; >@@ -55,20 +57,10 @@ if ( $op eq "do_search" ) { > my @value = $query->multi_param('value'); > $value[0] ||= q||; > >- my $valid_marc_list = { >- "all" => 1, >- "match" => 1, >- "mainentry" => 1, >- }; >- my @marclist = (); >- foreach my $entry (@input_marclist) { >- if ( $valid_marc_list->{$entry} ) { >- push( @marclist, $entry ); >- } >- } >- if ( !@marclist ) { >- push( @marclist, 'all' ); >- } >+ # validation of "Where" >+ my @valid_marc_list = qw( all match mainentry ); >+ my @marclist = intersect( @input_marclist, @valid_marc_list ); >+ @marclist = ('all') unless @marclist; > > my $builder = Koha::SearchEngine::QueryBuilder->new( > { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); >-- >2.43.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 35578
:
159856
|
159926
|
160984
|
160985
|
161235
| 161236