CRM-15595 - Individual sub-type custom fields don't appear in online event registration
[civicrm-core.git] / CRM / Event / Form / ManageEvent.php
index 6473a0ad34b5dc0df54f62fed4b6d25dcd150276..62b688c2e9af145009abe60f1a961cc62fb4475b 100644 (file)
@@ -104,7 +104,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'GET');
     if ($this->_id) {
       $this->assign('eventId', $this->_id);
-      if (empty($this->_addProfileBottom) && empty($this->_addProfileBottomAdd)) {
+      if (!empty($this->_addBlockName) && empty($this->_addProfileBottom) && empty($this->_addProfileBottomAdd)) {
         $this->add('hidden', 'id', $this->_id);
       }
       $this->_single = TRUE;
@@ -380,5 +380,13 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       return 'CRM/Event/Form/ManageEvent/Tab.tpl';
     }
   }
+
+  /**
+   * Pre-load libraries required by Online Registration Profile fields
+   */
+  static function addProfileEditScripts() {
+    CRM_UF_Page_ProfileEditor::registerProfileScripts();
+    CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ParticipantModel'));
+  }
 }