[REF] Pass params into function rather than this weird check for whether params exists.
authoreileen <emcnaughton@wikimedia.org>
Fri, 31 Jan 2020 03:58:59 +0000 (16:58 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 31 Jan 2020 03:58:59 +0000 (16:58 +1300)
This function used to be shared with the online form & hence this form had to work to make itself 'look' like the other form.

It is now free to be it's own form

CRM/Event/Form/Participant.php

index 929a130879da3dc3af5e45842869d4413149d0c8..819e95fc81cb9c92b60f7aca84833a665be7e04f 100644 (file)
@@ -1211,7 +1211,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       //CRM-15372 patch to fix fee amount replacing amount
       $this->_params['fee_amount'] = $this->_params['amount'];
 
-      $participants[] = $this->addParticipant($this, $contactID);
+      $participants[] = $this->addParticipant($this, $this->_params, $contactID);
 
       //add custom data for participant
       CRM_Core_BAO_CustomValueTable::postProcess($this->_params,
@@ -2083,11 +2083,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
    * @return \CRM_Event_BAO_Participant
    * @throws \CiviCRM_API3_Exception
    */
-  protected function addParticipant(&$form, $contactID) {
-    if (empty($form->_params)) {
-      return NULL;
-    }
-    $params = $form->_params;
+  protected function addParticipant(&$form, $params, $contactID) {
     $transaction = new CRM_Core_Transaction();
 
     // handle register date CRM-4320