Add :title as attribute for basic_topic
When we update the <title> after editing a topic, we should use the raw `topic.title` as `topic.fancy_title` may contains some htmlentities and will be displayed as is in the browser tab. This fix the following issue: > Incorrect HTML title after editing title/category of topic > http://meta.discourse.org/t/incorrect-html-title-after-editing-title-category-of-topic/8136
This commit is contained in:
parent
2e7eee7ebd
commit
d5285e2d93
|
@ -149,10 +149,11 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
|
||||||
// save the modifications
|
// save the modifications
|
||||||
topic.save().then(function(result){
|
topic.save().then(function(result){
|
||||||
// update the title if it has been changed (cleaned up) server-side
|
// update the title if it has been changed (cleaned up) server-side
|
||||||
var title = result.basic_topic.fancy_title;
|
var title = result.basic_topic.title;
|
||||||
|
var fancy_title = result.basic_topic.fancy_title;
|
||||||
topic.setProperties({
|
topic.setProperties({
|
||||||
title: title,
|
title: title,
|
||||||
fancy_title: title
|
fancy_title: fancy_title
|
||||||
});
|
});
|
||||||
|
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# The most basic attributes of a topic that we need to create a link for it.
|
# The most basic attributes of a topic that we need to create a link for it.
|
||||||
class BasicTopicSerializer < ApplicationSerializer
|
class BasicTopicSerializer < ApplicationSerializer
|
||||||
attributes :id, :fancy_title, :slug, :posts_count
|
attributes :id, :title, :fancy_title, :slug, :posts_count
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,6 @@ class ListableTopicSerializer < BasicTopicSerializer
|
||||||
:last_read_post_number,
|
:last_read_post_number,
|
||||||
:unread,
|
:unread,
|
||||||
:new_posts,
|
:new_posts,
|
||||||
:title,
|
|
||||||
:pinned,
|
:pinned,
|
||||||
:excerpt,
|
:excerpt,
|
||||||
:visible,
|
:visible,
|
||||||
|
|
Loading…
Reference in New Issue