From 83cadbd229b8aa3e0e961c4435f2f7f8e28a8683 Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Thu, 17 Jun 2021 10:46:32 -0400 Subject: [PATCH] dev/core#2657 trigger pre hook on LineItem delete --- CRM/Price/BAO/LineItem.php | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.25.1