Don't pass around paymentTableId
authoreileen <emcnaughton@wikimedia.org>
Wed, 10 Jul 2019 13:02:32 +0000 (01:02 +1200)
committereileen <emcnaughton@wikimedia.org>
Fri, 12 Jul 2019 00:38:43 +0000 (12:38 +1200)
CRM/Export/BAO/Export.php
CRM/Export/BAO/ExportProcessor.php

index e08727f3273d9a6dc20453981eea0b7f3ce12ff4..d8cee057ec0b1f096efd3e236dc9c571c0ae9df0 100644 (file)
@@ -198,7 +198,6 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
     if ($moreReturnProperties) {
       $processor->setAdditionalRequestedReturnProperties($moreReturnProperties);
     }
-    $paymentTableId = $processor->getPaymentTableID();
 
     list($query, $select, $from, $where, $having) = $processor->runQuery($params, $order);
 
@@ -313,7 +312,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
       while ($iterationDAO->fetch()) {
         $count++;
         $rowsThisIteration++;
-        $row = $processor->buildRow($query, $iterationDAO, $outputColumns, $metadata, $paymentDetails, $addPaymentHeader, $paymentTableId);
+        $row = $processor->buildRow($query, $iterationDAO, $outputColumns, $metadata, $paymentDetails, $addPaymentHeader, $processor);
         if ($row === FALSE) {
           continue;
         }
index b714d32e160bf488759f02a0ce3f6fd70ae1fb62..f39ae4902938e4c3803a9bdc332449f44c2dbf3e 100644 (file)
@@ -797,11 +797,12 @@ class CRM_Export_BAO_ExportProcessor {
    * @param $metadata
    * @param $paymentDetails
    * @param $addPaymentHeader
-   * @param $paymentTableId
+   * @param \CRM_Export_BAO_ExportProcessor $processor
    *
    * @return array|bool
    */
-  public function buildRow($query, $iterationDAO, $outputColumns, $metadata, $paymentDetails, $addPaymentHeader, $paymentTableId) {
+  public function buildRow($query, $iterationDAO, $outputColumns, $metadata, $paymentDetails, $addPaymentHeader, $processor) {
+    $paymentTableId = $processor->getPaymentTableID();
     if ($this->isHouseholdToSkip($iterationDAO->contact_id)) {
       return FALSE;
     }