From 6a2210b0d5e5ed733dd73c06ea18158b594bbce6 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 17 May 2023 14:51:54 +0200 Subject: [PATCH] #11221 fixed filter in Module Template Manager --- pandora_console/include/class/ModuleTemplates.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/class/ModuleTemplates.class.php b/pandora_console/include/class/ModuleTemplates.class.php index bfb02c7ae8..dab74a8846 100644 --- a/pandora_console/include/class/ModuleTemplates.class.php +++ b/pandora_console/include/class/ModuleTemplates.class.php @@ -1339,7 +1339,11 @@ class ModuleTemplates extends HTML function filterGroupComponents(e){ var selectedGroup = e.target.value; var entireList = JSON.parse($('#hidden-group-components').val()); - var componentsToShow = entireList[selectedGroup]; + if(typeof entireList[selectedGroup] !== 'undefined'){ + var componentsToShow = entireList[selectedGroup].split(","); + } else { + var componentsToShow = []; + } $('#add-modules-components').children().each(function(){ var id = $(this).val(); if (typeof componentsToShow === 'undefined' && selectedGroup != '0') { @@ -1348,7 +1352,7 @@ class ModuleTemplates extends HTML $(this).css('display','block'); } else { $(this).css('display','none'); - } + } }); }