Skip to content

Commit

Permalink
Fixes webhook#225 - set slug value on save
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzik committed Mar 31, 2015
1 parent 39c9c51 commit 74b6278
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/wh/content/type/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ export default Ember.ObjectController.extend({
this.set('previewUrl', controls.findBy('name', 'preview_url').get('value'));
}

// set slug to defaultSlug before save if value not manually set
if(!controls.findBy('name','slug').get('value')) {
controls.findBy('name','slug').set('value',this.get('defaultSlug'));
}

if (Ember.isEmpty(this.get('itemModel'))) {
this.set('itemModel', this.store.createRecord(this.get('model.itemModelName')));
}
Expand Down

1 comment on commit 74b6278

@kenzik
Copy link
Owner Author

@kenzik kenzik commented on 74b6278 Mar 31, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm second guessing this fix now because I'm not sure how it will impact the generator when something like '#' or some other custom mask is used for the slug definition on the content type.

I'll try to test some more early tomorrow morning and report back, unless I hear otherwise from the maintainers.

Please sign in to comment.