Skip to content

Commit

Permalink
Merge pull request #28645 from eileenmcnaughton/params
Browse files Browse the repository at this point in the history
[php8.x] Fully remove interaction with `_params` from backoffice participant form
  • Loading branch information
mattwire authored Dec 14, 2023
2 parents 8469329 + 8b05b0b commit 2ee04bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
19 changes: 8 additions & 11 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,7 @@ public static function formRule($values, $files, $self) {
* Process the form submission.
*/
public function postProcess() {
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);

$statusMsg = $this->submit($params);
$statusMsg = $this->submit($this->getSubmittedValues());
CRM_Core_Session::setStatus($statusMsg, ts('Saved'), 'success');
$session = CRM_Core_Session::singleton();
$buttonName = $this->controller->getButtonName();
Expand Down Expand Up @@ -862,7 +859,7 @@ public function postProcess() {
* @return string
* @throws \CRM_Core_Exception
*/
public function submit($params) {
public function submit(array $params) {
if ($this->_mode && !$this->_isPaidEvent) {
CRM_Core_Error::statusBounce(ts('Selected Event is not Paid Event '));
}
Expand All @@ -876,16 +873,16 @@ public function submit($params) {
$params['id'] = $this->_id;
}

$config = CRM_Core_Config::singleton();
if (isset($params['total_amount'])) {
$params['total_amount'] = CRM_Utils_Rule::cleanMoney($params['total_amount']);
}
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;
parent::beginPostProcess();
// @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'));
$this->assign('credit_card_number', CRM_Utils_System::mungeCreditCard($this->getSubmittedValue('credit_card_number')));
$amountOwed = NULL;
if (isset($params['amount'])) {
$amountOwed = $params['amount'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@
<td colspan="2" {$valueStyle}>
{$credit_card_type}<br/>
{$credit_card_number}<br/>
{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
</td>
</tr>
{/if}
Expand Down

0 comments on commit 2ee04bc

Please sign in to comment.