Bug 11889: (follow-up) Remove share if you are the new owner

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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2017-02-16 10:04:27 +01:00 committed by Tomas Cohen Arazi
parent 6ff09b16f1
commit 832aa74161
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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 );
}
}