From c8f8a3ad2b7193a64f7de2988f2bcffc9ed55a62 Mon Sep 17 00:00:00 2001 From: madhavimalgaonkar Date: Mon, 2 Jul 2018 12:22:55 +0530 Subject: [PATCH] dev/core#221, check if the grouptree is not empty --- CRM/Custom/Form/Preview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Custom/Form/Preview.php b/CRM/Custom/Form/Preview.php index b068f147c1..5264207a10 100644 --- a/CRM/Custom/Form/Preview.php +++ b/CRM/Custom/Form/Preview.php @@ -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)); -- 2.25.1