From f49108d654217af21e0f7a5fc2b7d6568faab96d 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 Content-Type: text/plain; charset=utf-8 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 2a7280aa01..a642b0dfaf 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -400,6 +400,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.20.1