From 9f45361c01b246a5e490bdebd67303072802e7e9 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 8 Sep 2021 08:31:47 -0400 Subject: [PATCH] Bug 28973: Improve Koha::Patron::can_see_patron_infos efficiency The method can_see_patron_infos looks up a row in the branches table by branchcode just to get the branchcode it already has. This seems inefficient. Test Plan: 1) Apply this patch 2) No changes should be noted Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 616c12a1e4238e0ffea722f669cce404511b046b) Signed-off-by: Fridolin Somers --- Koha/Patron.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 68877c2e10..511fc0b00f 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1336,7 +1336,7 @@ Return true if the patron (usually the logged in user) can see the patron's info sub can_see_patron_infos { my ( $self, $patron ) = @_; return unless $patron; - return $self->can_see_patrons_from( $patron->library->branchcode ); + return $self->can_see_patrons_from( $patron->branchcode ); } =head3 can_see_patrons_from -- 2.39.5