From 19dcc6bb7b03f3f7d422b534f7997b0d91ddb0ce Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 20 Feb 2020 16:41:50 +0000 Subject: [PATCH] FIX: Restore initState() call within discourse-location for subfolder d7d4612b2df2b4f87dfe64aafdcda8b8e8142c18 removed the duplicate call to initState(). However, we are relying on a side effect of the duplicate call for subfolder sites to function correctly when accessed without a trailing slash. To avoid a large refactor before the stable release, this commit restores the old behavior. Long term we should look at migrating to Ember's built-in location library, rather than maintaining our own (very similar) version https://github.com/emberjs/ember.js/blob/master/packages/%40ember/-internals/routing/lib/location/history_location.ts --- app/assets/javascripts/discourse/lib/discourse-location.js.es6 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 index ba03ee5017..20e8ad8c5d 100644 --- a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 +++ b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 @@ -18,6 +18,8 @@ const DiscourseLocation = EmberObject.extend({ this._super(...arguments); this.set("location", this.location || window.location); + + this.initState(); }, /**