From a841888db943b636006ce309ff1b9b81fa200bd2 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Tue, 25 Oct 2022 10:29:14 +0200 Subject: [PATCH] fix: [template:genericFilters] Do not fail if tag selector container doesn't exist --- templates/genericTemplates/filters.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/genericTemplates/filters.php b/templates/genericTemplates/filters.php index 33fb379..b101e09 100644 --- a/templates/genericTemplates/filters.php +++ b/templates/genericTemplates/filters.php @@ -118,7 +118,7 @@ echo $this->Bootstrap->modal([ } } $selectTag = modalObject.$modal.find('.tag-container select.select2-input') - activeFilters['filteringTags'] = $selectTag.select2('data').map(tag => tag.text) + activeFilters['filteringTags'] = $selectTag.length > 0 ? $selectTag.select2('data').map(tag => tag.text) : [] const searchParam = jQuery.param(activeFilters); const url = `/${controller}/${action}?${searchParam}`