From 9feace3388f3955e409d35df7ce125290636d7df Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 17 Feb 2020 10:39:04 +0100 Subject: [PATCH] FIX: prevents error when loading tag groups (#8983) --- .../templates/components/edit-category-tags.hbs | 10 +++++++--- .../select-kit/components/tag-group-chooser.js.es6 | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs b/app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs index 36151b12afc..593d8357443 100644 --- a/app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs +++ b/app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs @@ -2,12 +2,14 @@ {{tag-chooser id="category-allowed-tags" - filterPlaceholder="category.tags_placeholder" tags=category.allowed_tags everyTag=true excludeSynonyms=true unlimitedTagCount=true onChange=(action (mut category.allowed_tags)) + options=(hash + filterPlaceholder="category.tags_placeholder" + ) }} @@ -45,8 +47,10 @@ {{tag-group-chooser id="category-required-tag-group" tagGroups=category.required_tag_groups - maximum=1 - filterPlaceholder="category.tag_group_selector_placeholder" + options=(hash + maximum=1 + filterPlaceholder="category.tag_group_selector_placeholder" + ) }} diff --git a/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6 b/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6 index 8857d8cd63f..24a3af4ba3a 100644 --- a/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6 +++ b/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6 @@ -47,7 +47,7 @@ export default MultiSelectComponent.extend(TagsMixin, { ).then(results => { if (results && results.length) { return results.filter(r => { - return !this.tagGroups.includes(this.getValue(r)); + return !makeArray(this.tagGroups).includes(this.getValue(r)); }); } });