Bug 22067: Return if no patron passed to can_see_patron_infos
authorNick Clemens <nick@bywatersolutions.com>
Thu, 3 Jan 2019 20:52:15 +0000 (20:52 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 15 Feb 2019 18:42:44 +0000 (18:42 +0000)
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 <maryse.simard@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 <nick@bywatersolutions.com>
Koha/Patron.pm

index 25b3531..dff9320 100644 (file)
@@ -1092,6 +1092,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 );
 }