From 2c516400de748e1e5e02afacb8ded02d11e64943 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 19 Apr 2013 16:47:14 -0400 Subject: [PATCH] Fix links to topics with empty slug because they use non-ascii titles --- app/assets/javascripts/discourse/components/utilities.js | 2 ++ app/assets/javascripts/discourse/models/notification.js | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/components/utilities.js b/app/assets/javascripts/discourse/components/utilities.js index 05926e764ce..8ea65b2c26b 100644 --- a/app/assets/javascripts/discourse/components/utilities.js +++ b/app/assets/javascripts/discourse/components/utilities.js @@ -75,6 +75,8 @@ Discourse.Utilities = { url = Discourse.getURL("/t/"); if (slug) { url += slug + "/"; + } else { + url += 'topic/'; } url += topicId; if (postNumber > 1) { diff --git a/app/assets/javascripts/discourse/models/notification.js b/app/assets/javascripts/discourse/models/notification.js index fc05950b846..50b8c60a478 100644 --- a/app/assets/javascripts/discourse/models/notification.js +++ b/app/assets/javascripts/discourse/models/notification.js @@ -14,10 +14,8 @@ Discourse.Notification = Discourse.Model.extend({ }).property('read'), url: (function() { - var slug; if (this.blank('data.topic_title')) return ""; - slug = this.get('slug'); - return Discourse.getURL("/t/") + slug + "/" + (this.get('topic_id')) + "/" + (this.get('post_number')); + return Discourse.Utilities.postUrl(this.get('slug'), this.get('topic_id'), this.get('post_number')); }).property(), rendered: (function() {