Fix loading of profile fields on additional participant form
authorJitendra Purohit <jitendra@fuzion.co.nz>
Fri, 1 Nov 2019 12:20:48 +0000 (17:50 +0530)
committerJitendra Purohit <jitendra@fuzion.co.nz>
Fri, 1 Nov 2019 12:20:48 +0000 (17:50 +0530)
CRM/Event/Form/Registration/AdditionalParticipant.php

index 7e9eb11c5eaec3d8313de4c1818a50291194bc3e..fcc96e91304314f1e9e7394e43668df0aadda5e6 100644 (file)
@@ -178,8 +178,14 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
       CRM_Event_Form_Registration_Register::buildAmount($this);
     }
 
+    //Add pre and post profiles on the form.
+    foreach (['pre', 'post'] as $keys) {
+      if (isset($this->_values['additional_custom_' . $keys . '_id'])) {
+        $this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys));
+      }
+    }
+
     //add buttons
-    $js = NULL;
     if ($this->isLastParticipant(TRUE) && empty($this->_values['event']['is_monetary'])) {
       $this->submitOnce = TRUE;
     }