From 43d9ee68fc0eada3c554405d6d2b078b73be71f1 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 13 Oct 2023 09:56:00 -0400 Subject: [PATCH] Bug 31846: (QA follow-up) Tidy code to make qa script happy Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- C4/Serials.pm | 4 ++-- .../bug-31846-serials-search-results-limit.pl | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index dfa93ce1ca..ec88b0f3e6 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -628,8 +628,8 @@ sub SearchSubscriptions { my $total_results = @{$results}; - if ($params->{results_limit} && $total_results > $params->{results_limit}) { - $results = [splice(@{$results}, 0, $params->{results_limit})]; + if ( $params->{results_limit} && $total_results > $params->{results_limit} ) { + $results = [ splice( @{$results}, 0, $params->{results_limit} ) ]; } for my $subscription ( @$results ) { diff --git a/installer/data/mysql/atomicupdate/bug-31846-serials-search-results-limit.pl b/installer/data/mysql/atomicupdate/bug-31846-serials-search-results-limit.pl index d7309af900..30a8b2ef26 100755 --- a/installer/data/mysql/atomicupdate/bug-31846-serials-search-results-limit.pl +++ b/installer/data/mysql/atomicupdate/bug-31846-serials-search-results-limit.pl @@ -1,16 +1,20 @@ use Modern::Perl; return { - bug_number => "31846", + bug_number => "31846", description => "Add SerialsSearchResultsLimit syspref", - up => sub { + up => sub { my ($args) = @_; - my ($dbh, $out) = @$args{qw(dbh out)}; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + # Do you stuffs here - $dbh->do(q{ + $dbh->do( + q{ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('SerialsSearchResultsLimit', NULL, NULL, 'Serials search results limit', 'integer') - }); + } + ); + # Print useful stuff here say $out "SerialsSearchResultsLimit syspref added"; }, -- 2.39.5