From 11329fcab96e54d1dbc94efb866ee067fec75cc4 Mon Sep 17 00:00:00 2001 From: "uttkarsh@axelerant.com" Date: Thu, 28 Mar 2019 14:14:23 +0530 Subject: [PATCH] fixes 47 --- src/Element/TemplateCollectionList.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Element/TemplateCollectionList.php b/src/Element/TemplateCollectionList.php index 741b98c..7a3aa8b 100644 --- a/src/Element/TemplateCollectionList.php +++ b/src/Element/TemplateCollectionList.php @@ -64,10 +64,12 @@ public static function processTemplateCollectionList(&$element, FormStateInterfa // Add empty checkboxes form item. This will ensure 'checkboxes' always // exists in $form_state values. This is only an issue if there are no // checkboxes rendered initially (list is empty). - $element['checkboxes'] = [ - '#type' => 'checkboxes', - '#options' => NULL, - ]; + if (!$element['#checkboxes']) { + $element['checkboxes'] = [ + '#type' => 'checkboxes', + '#options' => [], + ]; + } if ($element['#checkboxes']) { $element['template_collection_list']['#attributes']['class'][] = 'checkboxes';