From 832aa7416193215fafe9b34e2681f1c32eee9505 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=utf8 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 Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- Koha/Patron.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 2fbb0e4f9a..d3e0714144 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -399,6 +399,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.39.5