mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Can edit 1st posts that have no categories
This commit is contained in:
parent
d4343487e6
commit
f337aea982
1 changed files with 9 additions and 4 deletions
|
@ -392,13 +392,18 @@ Discourse.Composer = Discourse.Model.extend({
|
|||
// Update the title if we've changed it
|
||||
if (this.get('title') && post.get('post_number') === 1) {
|
||||
var topic = this.get('topic');
|
||||
var category = Discourse.Category.list().findProperty('name', this.get('categoryName'));
|
||||
topic.setProperties({
|
||||
title: this.get('title'),
|
||||
fancy_title: this.get('title'),
|
||||
categoryName: category.get('name'),
|
||||
category_id: category.get('id')
|
||||
fancy_title: this.get('title')
|
||||
});
|
||||
|
||||
var category = Discourse.Category.list().findProperty('name', this.get('categoryName'));
|
||||
if (category) {
|
||||
topic.setProperties({
|
||||
categoryName: category.get('name'),
|
||||
category_id: category.get('id')
|
||||
});
|
||||
}
|
||||
topic.save();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue