From 29f2587b3db2ca8a951adc861a07d44fb4cb615f Mon Sep 17 00:00:00 2001 From: Nicolas Ganivet Date: Tue, 10 Oct 2017 00:26:37 -0600 Subject: [PATCH] CRM-21281: Restore entity reference in case the post hook needs it --- 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 2b782e48f8..f064c526b3 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -70,6 +70,8 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { // unset entity table and entity id in $params // we never update the entity table and entity id during update mode if ($id) { + $entity_id = $params['entity_id']; + $entity_table = $params['entity_table']; unset($params['entity_id'], $params['entity_table']); } else { @@ -102,6 +104,9 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { } if ($id) { + // CRM-21281: Restore entity reference in case the post hook needs it + $lineItemBAO->entity_id = $entity_id; + $lineItemBAO->entity_table = $entity_table; CRM_Utils_Hook::post('edit', 'LineItem', $id, $lineItemBAO); } else { -- 2.25.1