Bug 39644: Skip processing guarantor if already seen
To test: 1. In k-t-d try loading both member/moremember.pl and circ/circulation.pl for a patron with many guarantors. 2. Note the load times. 3. APPLY PATCH 4. Load times should now be reduced pretty significantly. 5. prove -v /kohadevbox/koha/t/db_dependent/Koha/Patron.t 6. No behavior should change. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
b16a015235
commit
8bd72af1ff
|
|
@ -634,6 +634,9 @@ sub relationships_debt {
|
|||
my $non_issues_charges = 0;
|
||||
my $seen = $include_this_patron ? {} : { $self->id => 1 }; # For tracking members already added to the total
|
||||
foreach my $guarantor (@guarantors) {
|
||||
if ( !$only_this_guarantor && $seen->{ $guarantor->id } ) {
|
||||
next;
|
||||
}
|
||||
$non_issues_charges += $guarantor->account->non_issues_charges
|
||||
if $include_guarantors && !$seen->{ $guarantor->id };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue