From f84e2e9d932f171dab1bc97360ea670d2ba86254 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 23 Jun 2019 08:41:49 +0200 Subject: [PATCH] Fix for distribution of event deletions --- src/Model/Event.php | 2 +- src/Model/Item.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Model/Event.php b/src/Model/Event.php index d8657c1e9..42742f18e 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -226,7 +226,7 @@ class Event extends BaseObject return; } - DBA::delete('event', ['id' => $event_id]); + DBA::delete('event', ['id' => $event_id], ['cascade' => false]); Logger::log("Deleted event ".$event_id, Logger::DEBUG); } diff --git a/src/Model/Item.php b/src/Model/Item.php index 579d2f68e..059838bdb 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1080,9 +1080,11 @@ class Item extends BaseObject } // When the permission set will be used in photo and events as well, // this query here needs to be extended. - if (!empty($item['psid']) && !self::exists(['psid' => $item['psid'], 'deleted' => false])) { - DBA::delete('permissionset', ['id' => $item['psid']], ['cascade' => false]); - } + // Currently deactivated. We need the permission set in the deletion process. + // This is a reminder to add the removal somewhere else. + //if (!empty($item['psid']) && !self::exists(['psid' => $item['psid'], 'deleted' => false])) { + // DBA::delete('permissionset', ['id' => $item['psid']], ['cascade' => false]); + //} // If it's the parent of a comment thread, kill all the kids if ($item['id'] == $item['parent']) {