From 65af07d3e3599e7f5c943c8ff9b15e9f43be3a7d Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 26 Jul 2016 15:21:46 +1000 Subject: [PATCH] Shift to Single Value Query as suggested by Eileen --- CRM/Contribute/Form/Task/PDF.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index e239690521..eea606e755 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -182,14 +182,11 @@ AND {$this->_componentClause}"; $input['trxn_date'] = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL; $input['receipt_update'] = $params['receipt_update']; $input['contribution_status_id'] = $contribution->contribution_status_id; - $payment_processor_id = NULL; - $processorDAO = CRM_Core_DAO::executeQuery("SELECT payment_processor_id + $payment_processor_id = CRM_Core_DAO::singleValueQuery("SELECT payment_processor_id FROM civicrm_financial_trxn - WHERE trxn_id = %1", array( + WHERE trxn_id = %1 + LIMIT 1", array( 1 => array($contribution->trxn_id, 'String'))); - while ($processorDAO->fetch()) { - $payment_processor_id = $processorDAO->payment_processor_id; - } $input['paymentProcessor'] = $payment_processor_id; // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date -- 2.25.1