From ba01526dbbf8685f2752c607442f6333cad3f849 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 23 Aug 2018 22:41:15 +1200 Subject: [PATCH] Fix ReportInstance BAO to call post hook after save (instead of calling pre twice). Also, remove one unused var --- CRM/Report/BAO/ReportInstance.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php index a7dc5733cb..7cc1f4eda1 100644 --- a/CRM/Report/BAO/ReportInstance.php +++ b/CRM/Report/BAO/ReportInstance.php @@ -45,7 +45,6 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { * @return CRM_Report_DAO_ReportInstance */ public static function add(&$params) { - $instance = new CRM_Report_DAO_ReportInstance(); if (empty($params)) { return NULL; } @@ -109,10 +108,10 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { $instance->save(); if ($instanceID) { - CRM_Utils_Hook::pre('edit', 'ReportInstance', $instance->id, $instance); + CRM_Utils_Hook::post('edit', 'ReportInstance', $instance->id, $instance); } else { - CRM_Utils_Hook::pre('create', 'ReportInstance', $instance->id, $instance); + CRM_Utils_Hook::post('create', 'ReportInstance', $instance->id, $instance); } return $instance; } -- 2.25.1