From 3c6340a67a8799fe8854fec28d7b742564161ae4 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 11 Jul 2019 00:50:37 +1200 Subject: [PATCH] Move code wrangling to the start --- CRM/Export/BAO/Export.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index 06ab07ed99..e08727f327 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -187,18 +187,18 @@ class CRM_Export_BAO_Export { INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_contact gc WHERE gc.group_id = {$exportParams['additional_group']} ON DUPLICATE KEY UPDATE {$componentTable}.contact_id = gc.contact_id" ); } - - $processor = new CRM_Export_BAO_ExportProcessor($exportMode, $fields, $queryOperator, $mergeSameHousehold, $isPostalOnly, $mergeSameAddress); - if ($moreReturnProperties) { - $processor->setAdditionalRequestedReturnProperties($moreReturnProperties); - } - $paymentTableId = $processor->getPaymentTableID(); - // rectify params to what proximity search expects if there is a value for prox_distance // CRM-7021 + // @todo - move this back to the calling functions if (!empty($params)) { CRM_Contact_BAO_ProximityQuery::fixInputParams($params); } + // @todo everything from this line up should go back to the calling functions. + $processor = new CRM_Export_BAO_ExportProcessor($exportMode, $fields, $queryOperator, $mergeSameHousehold, $isPostalOnly, $mergeSameAddress); + if ($moreReturnProperties) { + $processor->setAdditionalRequestedReturnProperties($moreReturnProperties); + } + $paymentTableId = $processor->getPaymentTableID(); list($query, $select, $from, $where, $having) = $processor->runQuery($params, $order); -- 2.25.1