From 393607d25c43cb022962a002599e08cfbf0eb4e4 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 3 Dec 2014 16:41:27 -0500 Subject: [PATCH] Patch Ember to fix https://github.com/emberjs/ember.js/issues/9805 --- .../javascripts/discourse/controllers/discovery/topics.js.es6 | 4 ++-- app/assets/javascripts/discourse/models/user.js | 2 +- vendor/assets/javascripts/development/ember.js | 4 ++++ vendor/assets/javascripts/production/ember.js | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 index 7624c96ab..f5bea7b6e 100644 --- a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 @@ -158,11 +158,11 @@ var controllerOpts = { }.property('allLoaded', 'topics.length'), footerEducation: function() { - if (!this.get('allLoaded') || this.get('topics.length') > 0 || !Discourse.User.current()) { return ""; } + if (!this.get('allLoaded') || this.get('topics.length') > 0 || !Discourse.User.current()) { return; } var split = this.get('filter').split('/'); - if (split[0] !== 'new' && split[0] !== 'unread' && split[0] !== 'starred') { return ""; } + if (split[0] !== 'new' && split[0] !== 'unread' && split[0] !== 'starred') { return; } return I18n.t("topics.none.educate." + split[0], { userPrefsUrl: Discourse.getURL("/users/") + (Discourse.User.currentProp("username_lower")) + "/preferences" diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index ab29c600a..47e36a415 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -92,7 +92,7 @@ Discourse.User = Discourse.Model.extend({ desc = I18n.t('user.moderator', {user: name}); return ''; } - return ""; + return null; }.property('admin','moderator'), /** diff --git a/vendor/assets/javascripts/development/ember.js b/vendor/assets/javascripts/development/ember.js index 9e52da89d..e8b57d0ad 100644 --- a/vendor/assets/javascripts/development/ember.js +++ b/vendor/assets/javascripts/development/ember.js @@ -10112,6 +10112,10 @@ enifed("ember-handlebars/string", @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars */ function htmlSafe(str) { + if (str === undefined || str === null) { + return ""; + } + if (typeof str !== 'string') { str = ''+str; } diff --git a/vendor/assets/javascripts/production/ember.js b/vendor/assets/javascripts/production/ember.js index d036d87d4..91d071be0 100644 --- a/vendor/assets/javascripts/production/ember.js +++ b/vendor/assets/javascripts/production/ember.js @@ -9819,6 +9819,10 @@ enifed("ember-handlebars/string", @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars */ function htmlSafe(str) { + if (str === undefined || str === null) { + return ""; + } + if (typeof str !== 'string') { str = ''+str; }