From: eileen Date: Sat, 18 Jan 2020 07:30:01 +0000 (+1300) Subject: Move the bounce to the start of the form submit X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8b6522931850cc0b8bb8781f8f159732bf12c043;p=civicrm-core.git Move the bounce to the start of the form submit --- diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index bcd441f278..78362d7c87 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -971,6 +971,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * @throws \CiviCRM_API3_Exception */ public function submit($params) { + if ($this->_mode && !$this->_isPaidEvent) { + CRM_Core_Error::statusBounce(ts('Selected Event is not Paid Event ')); + } $participantStatus = CRM_Event_PseudoConstant::participantStatus(); // set the contact, when contact is selected if (!empty($params['contact_id'])) { @@ -1023,9 +1026,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $now = date('YmdHis'); if ($this->_mode) { - if (!$this->_isPaidEvent) { - CRM_Core_Error::statusBounce(ts('Selected Event is not Paid Event ')); - } $eventTitle = CRM_Core_DAO::getFieldValue(