From c7fa569399fa26502bf4f32d458077e8edb252e5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 May 2021 12:08:21 +0200 Subject: [PATCH] Bug 28229: Count only if needed We don't need to count the number of clubs if we selected a patron or club already Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart (cherry picked from commit a197a09febd996176c841fa64080a663a4122e60) Signed-off-by: Fridolin Somers (cherry picked from commit c3ebd948cf95b2de108c48d74b30e0aa8cd5c5db) --- reserve/request.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index e5bbfe5041..d43e93acc2 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -167,11 +167,9 @@ if ( $biblionumbers ) { push @biblionumbers, $input->multi_param('biblionumber'); } -my $clubcount = Koha::Clubs->search->count; my $multi_hold = @biblionumbers > 1; $template->param( - multi_hold => $multi_hold, - clubcount => $clubcount, + multi_hold => $multi_hold, ); # If we have the borrowernumber because we've performed an action, then we @@ -273,6 +271,10 @@ if ($club_hold && !$borrowernumber_hold && !$action) { ); } +unless ( $club_hold or $borrowernumber_hold ) { + $template->param( clubcount => Koha::Clubs->search->count ); +} + $template->param( messageborrower => $messageborrower, messageclub => $messageclub -- 2.39.5