Skip to content

Commit

Permalink
Move wrangling payment header outside main row iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Nov 12, 2018
1 parent eee6fc8 commit 8eca64a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions CRM/Export/BAO/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ public static function exportComponents(

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}";
Expand Down Expand Up @@ -523,16 +533,6 @@ public static function exportComponents(
}
}

// 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);
}
Expand Down

0 comments on commit 8eca64a

Please sign in to comment.