From: Eileen McNaughton Date: Tue, 2 Jun 2015 09:52:30 +0000 (+1200) Subject: Remove some unused params & a call by reference X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=35cd38f5dd0b4a06599b7f66677077b348a356a0;p=civicrm-core.git Remove some unused params & a call by reference --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 0eb61aab7f..b12a35e6c1 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2196,10 +2196,7 @@ WHERE contribution_id = %1 "; //what does recur 'mean here - to do with payment processor return functionality but // what is the importance if ($recur && !empty($this->_relatedObjects['paymentProcessor'])) { - $paymentObject = &CRM_Core_Payment::singleton( - $this->is_test ? 'test' : 'live', - $this->_relatedObjects['paymentProcessor'] - ); + $paymentObject = Civi\Payment\System::singleton()->getByProcessor($this->_relatedObjects['paymentProcessor']); $entityID = $entity = NULL; if (isset($ids['contribution'])) { diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 202d22066d..a94aea1923 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -100,7 +100,7 @@ class CRM_Contribute_BAO_Contribution_Utils { //fix for CRM-2062 //fix for CRM-16317 - $now = $form->_params['receive_date'] = date('YmdHis'); + $form->_params['receive_date'] = date('YmdHis'); $form->assign('receive_date', CRM_Utils_Date::mysqlToIso($form->_params['receive_date']) ); diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index a74688cc2c..b41405eec5 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -736,17 +736,14 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr // add a description field at the very beginning $this->_params['description'] = ts('Online Contribution') . ': ' . (($this->_pcpInfo['title']) ? $this->_pcpInfo['title'] : $this->_values['title']); - // also add accounting code - $this->_params['accountingCode'] = CRM_Utils_Array::value('accountingCode', - $this->_values - ); + $this->_params['accountingCode'] = CRM_Utils_Array::value('accountingCode', $this->_values); // fix currency ID $this->_params['currencyID'] = CRM_Core_Config::singleton()->defaultCurrency; //carry payment processor id. - if ($paymentProcessorId = CRM_Utils_Array::value('id', $this->_paymentProcessor)) { - $this->_params['payment_processor_id'] = $paymentProcessorId; + if (CRM_Utils_Array::value('id', $this->_paymentProcessor)) { + $this->_params['payment_processor_id'] = $this->_paymentProcessor['id']; } if (!empty($params['image_URL'])) { CRM_Contact_BAO_Contact::processImageParams($params);