diff --git a/app/assets/javascripts/discourse/models/composer.js b/app/assets/javascripts/discourse/models/composer.js
index 0d63fe54e..7d5a17a8c 100644
--- a/app/assets/javascripts/discourse/models/composer.js
+++ b/app/assets/javascripts/discourse/models/composer.js
@@ -392,10 +392,12 @@ 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: this.get('categoryName')
+ categoryName: category.get('name'),
+ category_id: category.get('id')
});
topic.save();
}
diff --git a/app/assets/javascripts/discourse/templates/topic.js.handlebars b/app/assets/javascripts/discourse/templates/topic.js.handlebars
index 95afda326..e66324b40 100644
--- a/app/assets/javascripts/discourse/templates/topic.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/topic.js.handlebars
@@ -21,7 +21,7 @@
{{topicStatus topic=model}}
{{{fancy_title}}}
{{/if}}
- {{categoryLink category}}
+ {{boundCategoryLink category}}
{{#if details.can_edit}}