From: Brian Shaughnessy Date: Thu, 17 Jun 2021 14:46:32 +0000 (-0400) Subject: dev/core#2657 trigger pre hook on LineItem delete X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=83cadbd229b8aa3e0e961c4435f2f7f8e28a8683;p=civicrm-core.git dev/core#2657 trigger pre hook on LineItem delete --- diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 183019dbe5..f4271716aa 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -346,6 +346,11 @@ WHERE li.contribution_id = %1"; $entityId = [$entityId]; } + $params = []; + foreach ($entityId as $id) { + CRM_Utils_Hook::pre('delete', 'LineItem', $id, $params); + } + $query = "DELETE FROM civicrm_line_item where entity_id IN ('" . implode("','", $entityId) . "') AND entity_table = '$entityTable'"; $dao = CRM_Core_DAO::executeQuery($query); return TRUE;