diff --git a/ghost/admin/app/controllers/post-settings-menu.js b/ghost/admin/app/controllers/post-settings-menu.js index 50d3193fa8..9e589dbed2 100644 --- a/ghost/admin/app/controllers/post-settings-menu.js +++ b/ghost/admin/app/controllers/post-settings-menu.js @@ -493,6 +493,10 @@ export default Ember.Controller.extend(SettingsMenuMixin, { tagToAdd = self.get('store').createRecord('tag', { name: tagName }); + + // we need to set a UUID so that selectize has a unique value + // it will be ignored when sent to the server + tagToAdd.set('uuid', Ember.guidFor(tagToAdd)); } // push tag onto post relationship diff --git a/ghost/admin/app/models/post.js b/ghost/admin/app/models/post.js index 99c0f18fe7..d81c8ea076 100644 --- a/ghost/admin/app/models/post.js +++ b/ghost/admin/app/models/post.js @@ -59,6 +59,7 @@ export default DS.Model.extend(ValidationEngine, { // remove client-generated tags, which have `id: null`. // Ember Data won't recognize/update them automatically // when returned from the server with ids. + // https://github.com/emberjs/data/issues/1829 updateTags: function () { var tags = this.get('tags'), oldTags = tags.filterBy('id', null); diff --git a/ghost/admin/app/templates/post-settings-menu.hbs b/ghost/admin/app/templates/post-settings-menu.hbs index 147552288d..aa2715d05c 100644 --- a/ghost/admin/app/templates/post-settings-menu.hbs +++ b/ghost/admin/app/templates/post-settings-menu.hbs @@ -40,7 +40,7 @@ multiple=true selection=model.tags content=availableTags - optionValuePath="content.name" + optionValuePath="content.uuid" optionLabelPath="content.name" create-item="addTag" remove-item="removeTag"}}