From 63b17b8ee94e2788bff2d7d32c93ef6d347ce3e4 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 12 Nov 2018 14:50:31 +1300 Subject: [PATCH] Move wrangling payment header outside main row iteration --- CRM/Export/BAO/Export.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index 99ba90ee5a..5699194a4a 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -459,6 +459,16 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c list($outputColumns, $headerRows, $sqlColumns, $metadata) = self::getExportStructureArrays($returnProperties, $processor); + // add payment headers if required + if ($addPaymentHeader && $processor->isExportPaymentFields()) { + // @todo rather than do this for every single row do it before the loop starts. + // where other header definitions take place. + $headerRows = array_merge($headerRows, $processor->getPaymentHeaders()); + foreach (array_keys($processor->getPaymentHeaders()) as $paymentHdr) { + self::sqlColumnDefn($processor, $sqlColumns, $paymentHdr); + } + } + $limitReached = FALSE; while (!$limitReached) { $limitQuery = "{$queryString} LIMIT {$offset}, {$rowCount}"; @@ -523,16 +533,6 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c } } - // add payment headers if required - if ($addPaymentHeader && $processor->isExportPaymentFields()) { - // @todo rather than do this for every single row do it before the loop starts. - // where other header definitions take place. - $headerRows = array_merge($headerRows, $processor->getPaymentHeaders()); - foreach (array_keys($processor->getPaymentHeaders()) as $paymentHdr) { - self::sqlColumnDefn($processor, $sqlColumns, $paymentHdr); - } - } - if ($setHeader) { $exportTempTable = self::createTempTable($sqlColumns); } -- 2.25.1