From 435cbc402008d8c650c0208db8b90e8dca8b58d2 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 19 Dec 2023 08:06:49 +1300 Subject: [PATCH] Remove unused undeclared property _params, provide __get for transitional support --- CRM/Contribute/Form/AbstractEditPayment.php | 18 ++++++++++++++++++ CRM/Event/Form/Participant.php | 3 --- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index aff8f72a66..4d2e87b2ae 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -234,6 +234,24 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task { */ protected $invoiceID; + /** + * Provide support for extensions that are used to being able to retrieve _lineItem + * + * Note extension should call getPriceSetID() and getLineItems() directly. + * They are supported for external use per the api annotation. + * + * @param string $name + * + * @noinspection PhpUnhandledExceptionInspection + */ + public function __get($name) { + if ($name === '_params') { + CRM_Core_Error::deprecatedWarning('attempt to access undefined property _params - use externally supported function getSubmittedValues()'); + return $this->getSubmittedValues(); + } + CRM_Core_Error::deprecatedWarning('attempt to access invalid property :' . $name); + } + /** * Get the unique invoice ID. * diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 6a75c28eaf..a1d4eb4083 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -876,9 +876,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment if ($this->_isPaidEvent) { [$lineItem, $params] = $this->preparePaidEventProcessing($params); } - // @todo - params is unused - remove in favour of __get - // but there is another parameter we need to fix first. - $this->_params = $params; // @todo - stop assigning these - pass financial_trxnId in token context // and swap template to use tokens. $this->assign('credit_card_type', $this->getSubmittedValue('credit_card_type')); -- 2.25.1