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>
This commit is contained in:
parent
59d43e8d48
commit
10c8a373fb
|
|
@ -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