Use form property rather than passing mode
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 24 Nov 2023 23:54:52 +0000 (12:54 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 24 Nov 2023 23:54:52 +0000 (12:54 +1300)
CRM/Event/Form/Participant.php

index 782ef00f896aa88650336c2f5093d71ebde66e20..b42fe1718a453d695902152f935339aa24ef4e8e 100644 (file)
@@ -968,9 +968,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         $this->_params = array_merge($this->_params, $result);
       }
 
-      //add contribution record
-      $this->_params['mode'] = $this->_mode;
-
       //add contribution record
       $contributions[] = $contribution = $this->processContribution(
         $this, $this->_params,
@@ -1545,7 +1542,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     }
 
     $contribParams['is_test'] = 0;
-    if ($form->_action & CRM_Core_Action::PREVIEW || ($params['mode'] ?? NULL) === 'test') {
+    if ($form->_action & CRM_Core_Action::PREVIEW || ($this->_mode ?? NULL) === 'test') {
       $contribParams['is_test'] = 1;
     }