From 9a73be67c53620a86c18a99acd7fec0aa796271d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 17 Jun 2022 10:13:41 +0000 Subject: [PATCH] Bug 30327: Fix tests Corrected variable name on update to match everywhere else Added a default value for limit in buildQuery and only append limit if it has content Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit daab31ab38ea1d9c2992af51d38f30f318c3546b) Signed-off-by: Lucas Gass --- C4/Search.pm | 4 ++-- .../atomicupdate/bug_30327_add_sortComponents_syspref.pl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 484d9471d8..3ed70a791b 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1217,7 +1217,7 @@ sub buildQuery { my $query_cgi; my $query_type; - my $limit; + my $limit = q{}; my $limit_cgi; my $limit_desc; @@ -1328,7 +1328,7 @@ sub buildQuery { # This is needed otherwise ccl= and &limit won't work together, and # this happens when selecting a subject on the opac-detail page my $original_q = $q; # without available part - $q .= $limit; + $q .= $limit if $limit; return ( undef, $q, $q, "q=ccl=".uri_escape_utf8($q), $original_q, '', '', '', 'ccl' ); } if ( $query =~ /^cql=/ ) { diff --git a/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl b/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl index 0cb8f16dac..7c64d24c53 100755 --- a/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl +++ b/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl @@ -8,8 +8,8 @@ return { my ($dbh, $out) = @$args{qw(dbh out)}; $dbh->do(q{ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES - ('ComponentsSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), - ('ComponentsSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice') + ('ComponentSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), + ('ComponentSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice') }); say $out "Added ComponentsSortField and ComponentsSortOrder sysprefs"; }, -- 2.39.5