From a09323e9ab2e0e3a97959ffe3dc0cb4d40e3b162 Mon Sep 17 00:00:00 2001 From: scardinius Date: Thu, 2 Aug 2018 14:09:41 +0200 Subject: [PATCH] [dev/core#457] Add $ids to hook_civicrm_export --- CRM/Export/BAO/Export.php | 2 +- CRM/Utils/Hook.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index dede641e78e0..fec624e51fd6 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -600,7 +600,7 @@ public static function exportComponents( } // call export hook - CRM_Utils_Hook::export($exportTempTable, $headerRows, $sqlColumns, $exportMode); + CRM_Utils_Hook::export($exportTempTable, $headerRows, $sqlColumns, $exportMode, $componentTable, $ids); // In order to be able to write a unit test against this function we need to suppress // the csv writing. In future hopefully the csv writing & the main processing will be in separate functions. diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 92989a902534..45746c7aa23c 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1263,12 +1263,17 @@ public static function notePrivacy(&$noteValues) { * SQL columns. * @param int $exportMode * Export mode ( contact, contribution, etc...). + * @param string $componentTable + * Name of temporary table + * @param array $ids + * Array of object's ids * * @return mixed */ - public static function export(&$exportTempTable, &$headerRows, &$sqlColumns, &$exportMode) { - return self::singleton()->invoke(array('exportTempTable', 'headerRows', 'sqlColumns', 'exportMode'), $exportTempTable, $headerRows, $sqlColumns, $exportMode, - self::$_nullObject, self::$_nullObject, + public static function export(&$exportTempTable, &$headerRows, &$sqlColumns, &$exportMode, &$componentTable, &$ids) { + return self::singleton()->invoke(array('exportTempTable', 'headerRows', 'sqlColumns', 'exportMode', 'componentTable', 'ids'), + $exportTempTable, $headerRows, $sqlColumns, + $exportMode, $componentTable, $ids, 'civicrm_export' ); }