Skip to content

Commit

Permalink
Fixes #143
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervriends committed Jul 1, 2022
1 parent 2093363 commit 10598cc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/src/admin/components/Modals/SelectCategoriesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,17 @@ export default class SelectCategoriesModal extends Modal {

this.isSaving = true;

// Validate tags and prevent ghost tags (deleted tags)
let validBlogTags = [];

this.blogCategories.map((tagId) => {
if (app.store.getById('tags', tagId)) {
validBlogTags.push(tagId);
}
});

saveSettings({
blog_tags: this.blogCategories.join('|'),
blog_tags: validBlogTags.join('|'),
})
.then(() => {
app.alerts.show(
Expand Down

0 comments on commit 10598cc

Please sign in to comment.