From 0dd262a02eb162da2636c420c7d988adaa1640d8 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 3 Jan 2019 20:52:15 +0000 Subject: [PATCH] Bug 22067: Return if no patron passed to can_see_patron_infos To test: 1 - Find an adult patron 2 - Add a child to their account 3 - Delete the parent from the db 4 - Attempt to edit the child record 5 - Apply patch 6 - Repeat 7 - Note you can edit the child account 8 - Note guarantor id is not a link Signed-off-by: Maryse Simard Signed-off-by: Marcel de Rooy No blocker for me, but we are a bit hiding that guarantorid probably should be a foreign key cleared to NULL at deletion time. Signed-off-by: Nick Clemens (cherry picked from commit 5324268e099ead7a6864d16bae0f051444a1d34e) Signed-off-by: Martin Renvoize (cherry picked from commit e7201d27af1ca0c83ba66b69b4836c21b4905dda) Signed-off-by: Lucas Gass --- Koha/Patron.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 1005de618d..21362f5ab1 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -845,6 +845,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 ); } -- 2.39.5