fix: [template:genericFilters] Do not fail if tag selector container doesn't exist

pull/121/head
Sami Mokaddem 2022-10-25 10:29:14 +02:00
parent 6d40968f24
commit a841888db9
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 1 additions and 1 deletions

View File

@ -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}`