Bug 36155: Improve perfs of suggestion.pl when there are many budgets
Page suggestion/suggestion.pl calls CanUserUseBudget() in a loop,
will must use a uniq Koha::Patron object of the logged in user.
When there are many budgets and funds this takes some time.
Test plan :
Compare performance with and without patch with many budgets and funds
(see test plan of Bug 35921)
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 10c8a373fb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
ad886b5869
commit
b3704edcac
|
|
@ -548,7 +548,7 @@ $template->param( patron_reason_loop => $patron_reason_loop );
|
|||
my $sugg_budget_loop = [];
|
||||
my $sugg_budgets = GetBudgetHierarchy();
|
||||
foreach my $r ( @{$sugg_budgets} ) {
|
||||
next unless ( CanUserUseBudget( $borrowernumber, $r, $userflags ) );
|
||||
next unless ( CanUserUseBudget( $librarian->unblessed, $r, $userflags ) );
|
||||
my $selected = ( $$suggestion_ref{budgetid} && $r->{budget_id} eq $$suggestion_ref{budgetid} ) ? 1 : 0;
|
||||
push @{$sugg_budget_loop},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue