From: Allen Shaw Date: Tue, 12 Mar 2013 06:03:13 +0000 (-0500) Subject: Fix CRM-12013. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e026db3c7f8b60b12ee55d08b3f18746248cb0d5;p=civicrm-core.git Fix CRM-12013. --- 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