dev/core#221, check if the grouptree is not empty
authormadhavimalgaonkar <madhavim2694@gmail.com>
Mon, 2 Jul 2018 06:52:55 +0000 (12:22 +0530)
committermadhavimalgaonkar <madhavim2694@gmail.com>
Mon, 2 Jul 2018 06:52:55 +0000 (12:22 +0530)
CRM/Custom/Form/Preview.php

index b068f147c1891df3af06b422c1e289eb61d71472..5264207a1036689615119c247de6090b0ce51846 100644 (file)
@@ -109,7 +109,7 @@ class CRM_Custom_Form_Preview extends CRM_Core_Form {
    * @return void
    */
   public function buildQuickForm() {
-    if (is_array($this->_groupTree[$this->_groupId])) {
+    if (is_array($this->_groupTree) && !empty($this->_groupTree[$this->_groupId])) {
       foreach ($this->_groupTree[$this->_groupId]['fields'] as & $field) {
         //add the form elements
         CRM_Core_BAO_CustomField::addQuickFormElement($this, $field['element_name'], $field['id'], CRM_Utils_Array::value('is_required', $field));