Fix row ID input not being added for delete form
[civicrm-core.git] / CRM / Event / Form / Participant.php
index a1b1c61c17b0f7ab9dc9fc50f89d976fc513723b..fc7b0547f3b8c7636eb6d17b1144bc12412e9731 100644 (file)
@@ -594,6 +594,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
    * @throws \CiviCRM_API3_Exception
    */
   public function buildQuickForm() {
+    if ($this->_id) {
+      $this->add('hidden', 'id', $this->_id);
+    }
+
     $participantStatuses = CRM_Event_PseudoConstant::participantStatus();
     $partiallyPaidStatusId = array_search('Partially paid', $participantStatuses);
     $this->assign('partiallyPaidStatusId', $partiallyPaidStatusId);
@@ -689,7 +693,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
 
     if ($this->_id) {
       $this->assign('entityID', $this->_id);
-      $this->add('hidden', 'id', $this->_id);
     }
 
     $this->addSelect('role_id', ['multiple' => TRUE, 'class' => 'huge'], TRUE);