Bugzilla – Attachment 181679 Details for
Bug 39644
Too many borrower_relationships causes patron page to not load
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39644: Skip processing guarantor if already seen
Bug-39644-Skip-processing-guarantor-if-already-see.patch (text/plain), 1.18 KB, created by
Lucas Gass (lukeg)
on 2025-04-29 17:31:43 UTC
(
hide
)
Description:
Bug 39644: Skip processing guarantor if already seen
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-04-29 17:31:43 UTC
Size:
1.18 KB
patch
obsolete
>From ba25de098292b61e0365c2be64f909224cdef712 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 29 Apr 2025 17:27:05 +0000 >Subject: [PATCH] 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. >--- > Koha/Patron.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 56df7f9b8da..e384393c1b5 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -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 }; > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39644
:
181679
|
181683
|
181685
|
182082