From 727827dc254ffa0c3726d344d5039a729fd18140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Fri, 28 Aug 2015 12:31:32 +0200 Subject: [PATCH] FIX: error when loading admin > flags --- app/assets/javascripts/admin/templates/flags-list.hbs | 2 +- app/assets/javascripts/discourse/models/topic.js.es6 | 1 + app/serializers/flagged_topic_serializer.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/templates/flags-list.hbs b/app/assets/javascripts/admin/templates/flags-list.hbs index 67f4a2a87..9b404b992 100644 --- a/app/assets/javascripts/admin/templates/flags-list.hbs +++ b/app/assets/javascripts/admin/templates/flags-list.hbs @@ -32,7 +32,7 @@ {{fa-icon "envelope"}} {{/if}} {{topic-status topic=flaggedPost.topic}} - {{{flaggedPost.topic.fancyTitle}}} + {{{unbound flaggedPost.topic.fancyTitle}}} {{#if flaggedPost.postAuthorFlagged}} {{{flaggedPost.excerpt}}} diff --git a/app/assets/javascripts/discourse/models/topic.js.es6 b/app/assets/javascripts/discourse/models/topic.js.es6 index 2c14d86be..157af104d 100644 --- a/app/assets/javascripts/discourse/models/topic.js.es6 +++ b/app/assets/javascripts/discourse/models/topic.js.es6 @@ -10,6 +10,7 @@ const Topic = RestModel.extend({ @computed('fancy_title') fancyTitle(title) { + title = title || ""; title = Discourse.Emoji.unescape(title); return Discourse.CensoredWords.censor(title); }, diff --git a/app/serializers/flagged_topic_serializer.rb b/app/serializers/flagged_topic_serializer.rb index 2e5e08b08..bf6bcf4df 100644 --- a/app/serializers/flagged_topic_serializer.rb +++ b/app/serializers/flagged_topic_serializer.rb @@ -1,6 +1,7 @@ class FlaggedTopicSerializer < ActiveModel::Serializer attributes :id, :title, + :fancy_title, :slug, :archived, :closed,