0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Merge pull request #5727 from kevinansfield/fix-disappearing-tags-on-save

Fix new tags disappearing in PSM when saving post
This commit is contained in:
Hannah Wolfe 2015-08-26 19:58:31 +01:00
commit 79f1bd2571
3 changed files with 6 additions and 1 deletions

View file

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

View file

@ -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);

View file

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