From 1b56bd0102eb2ed2b47a4a61d09482f8b58a0000 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 7 Oct 2016 11:21:11 +0530 Subject: [PATCH] CRM-19352-notice fix --- CRM/Custom/Form/CustomData.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index 51547d825e..9692791efc 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -152,11 +152,13 @@ class CRM_Custom_Form_CustomData { */ public static function setGroupTree(&$form, $subType, $gid, $onlySubType = NULL, $getCachedTree = FALSE) { $singleRecord = NULL; - if (!empty($form->_groupCount) && $form->_multiRecordDisplay == 'single') { + if (!empty($form->_groupCount) && !empty($form->_multiRecordDisplay) && $form->_multiRecordDisplay == 'single') { $singleRecord = $form->_groupCount; } $mode = CRM_Utils_Request::retrieve('mode', 'String', $form); - if ($form->_groupCount == 0 && $mode == 'add' && $form->_multiRecordDisplay == 'single') { + // when a new record is being added for multivalued custom fields. + if (isset($form->_groupCount) && $form->_groupCount == 0 && $mode == 'add' && + !empty($form->_multiRecordDisplay) && $form->_multiRecordDisplay == 'single') { $singleRecord = 'new'; } -- 2.25.1