From fc433f957a9d0385e2362fd6bf94a07a81296725 Mon Sep 17 00:00:00 2001 From: AntonLV Date: Thu, 12 Dec 2024 15:07:11 +0300 Subject: [PATCH] Ticket #4856 - Privacy: Membership levels from custom groups aren't deleted with deleted content. --- inc/classes/BxDolPrivacyQuery.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/classes/BxDolPrivacyQuery.php b/inc/classes/BxDolPrivacyQuery.php index 9aa50f80c1..47ef37be61 100644 --- a/inc/classes/BxDolPrivacyQuery.php +++ b/inc/classes/BxDolPrivacyQuery.php @@ -282,8 +282,10 @@ public function deleteGroupCustom($aParamsWhere) return true; $bResult = $this->query("DELETE FROM `sys_privacy_groups_custom` WHERE " . $sWhereClause . " LIMIT 1") !== false; - if($bResult) - $this->deleteGroupCustomMember(array('group_id' => $aGroup['id'])); + if($bResult) { + $this->deleteGroupCustomMember(['group_id' => $aGroup['id']]); + $this->deleteGroupCustomMembership(['group_id' => $aGroup['id']]); + } return $bResult; }