From fb61a5011b6523693fb8484140e2b9320cc61b5d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 16 Feb 2017 10:04:27 +0100 Subject: [PATCH] Bug 11889: [Follow-up] Remove share if you are the new owner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will probably be exceptional. But if the staff member already had a share for a private list of the patron he deletes now, he will be the new owner and we should remove the share record. Signed-off-by: Marcel de Rooy Signed-off-by: Cédric Vita --- Koha/Patron.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 6437463..6311566 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -80,6 +80,8 @@ sub delete { } foreach my $slist ( @sharedlists ) { $slist->set({ owner => $usernumber })->store; + # if staff member had a share, remove it + $slist->remove_share( $usernumber ); } } -- 2.7.4