From: eileen Date: Wed, 10 Jul 2019 12:46:36 +0000 (+1200) Subject: Minor code relocation X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7d6dd61c67dfe1bb6af2805cc6905c4fc77d2924;p=civicrm-core.git Minor code relocation n --- diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index 4b5e3232f0..9b3022555d 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -182,20 +182,22 @@ class CRM_Export_BAO_Export { $mappedFields[] = CRM_Core_BAO_Mapping::getMappingParams([], $field); } + if (!$selectAll && $componentTable && !empty($exportParams['additional_group'])) { + // If an Additional Group is selected, then all contacts in that group are + // added to the export set (filtering out duplicates). + // Really - the calling function could do this ... just saying + // @todo take a whip to the calling function. + CRM_Core_DAO::executeQuery(" +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, $mappedFields, $queryOperator, $mergeSameHousehold, $isPostalOnly, $mergeSameAddress); if ($moreReturnProperties) { $processor->setAdditionalRequestedReturnProperties($moreReturnProperties); } $paymentTableId = $processor->getPaymentTableID(); - if (!$selectAll && $componentTable && !empty($exportParams['additional_group'])) { - // If an Additional Group is selected, then all contacts in that group are - // added to the export set (filtering out duplicates). - $query = " -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"; - CRM_Core_DAO::executeQuery($query); - } - if ($processor->getRequestedFields() && $processor->isPostalableOnly() ) {