From e026db3c7f8b60b12ee55d08b3f18746248cb0d5 Mon Sep 17 00:00:00 2001 From: Allen Shaw Date: Tue, 12 Mar 2013 01:03:13 -0500 Subject: [PATCH] Fix CRM-12013. --- CRM/Export/BAO/Export.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index f3963e4e1a..c3e7d57393 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -996,16 +996,20 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c //build header only once $setHeader = FALSE; - // add payment related information - if ($paymentFields) { - $paymentData = CRM_Utils_Array::value($row[$paymentTableId], $paymentDetails); - if (!is_array($paymentData) || empty($paymentData)) { - $paymentData = $nullContributionDetails; + // If specific payment fields have been selected for export, payment + // data will already be in $row. Otherwise, add payment related + // information, if appropriate. + if (!$selectedPaymentFields) { + if ($paymentFields) { + $paymentData = CRM_Utils_Array::value($row[$paymentTableId], $paymentDetails); + if (!is_array($paymentData) || empty($paymentData)) { + $paymentData = $nullContributionDetails; + } + $row = array_merge($row, $paymentData); } - $row = array_merge($row, $paymentData); - } elseif (!empty($paymentDetails)) { - $row = array_merge($row, $nullContributionDetails); + $row = array_merge($row, $nullContributionDetails); + } } //remove organization name for individuals if it is set for current employer -- 2.25.1