From e9bb043a461aa205e9ea092c2334b566a952a2bb Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 29 Nov 2017 20:03:27 +1300 Subject: [PATCH] CRM-21482 follow up notice fix - make signature a makes with inheriting abstract payment class. I'd really have liked to removed $submittedValues from the AbstractEditPayment class but it felt too risky since there are a lot of unpredictable params in there. Only CRM_Contribute_Form_Contribution actually calls that line. --- CRM/Contribute/Form/AbstractEditPayment.php | 6 +++--- CRM/Core/Form.php | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 0e1868a3ca..be61e8a8a9 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -375,11 +375,11 @@ WHERE contribution_id = {$id} /** * Get current currency from DB or use default currency. * - * @param $submittedValues + * @param array $submittedValues * - * @return mixed + * @return string */ - public function getCurrency($submittedValues) { + public function getCurrency($submittedValues = array()) { $config = CRM_Core_Config::singleton(); $currentCurrency = CRM_Utils_Array::value('currency', diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index f0ae764edd..d6035cad3d 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -2366,8 +2366,15 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @todo this should be overriden on the forms rather than having this * historic, possible handling in here. As we clean that up we should * add deprecation notices into here. + * + * @param array $submittedValues + * Array allowed so forms inheriting this class do not break. + * Ideally we would make a clear standard around how submitted values + * are stored (is $this->_values consistently doing that?). + * + * @return string */ - public function getCurrency() { + public function getCurrency($submittedValues = array()) { $currency = CRM_Utils_Array::value('currency', $this->_values); // For event forms, currency is in a different spot if (empty($currency)) { -- 2.25.1