From a5ca41b36259ef4bf440b926897601bceca24362 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 2 Dec 2016 16:55:16 -0500 Subject: [PATCH] FIX: sort by column headings in topic list when filtered by tag --- .../javascripts/discourse/routes/app-route-map.js.es6 | 2 +- .../discourse/routes/tags-intersection.js.es6 | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/discourse/routes/tags-intersection.js.es6 diff --git a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 index 76f3803c9f..a1de0bfc74 100644 --- a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 +++ b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 @@ -132,7 +132,7 @@ export default function() { this.route('showCategory' + filter.capitalize(), {path: '/c/:category/:tag_id/l/' + filter}); this.route('showParentCategory' + filter.capitalize(), {path: '/c/:parent_category/:category/:tag_id/l/' + filter}); }); - this.route('show', {path: 'intersection/:tag_id/*additional_tags'}); + this.route('intersection', {path: 'intersection/:tag_id/*additional_tags'}); }); this.route('tagGroups', {path: '/tag_groups', resetNamespace: true}, function() { diff --git a/app/assets/javascripts/discourse/routes/tags-intersection.js.es6 b/app/assets/javascripts/discourse/routes/tags-intersection.js.es6 new file mode 100644 index 0000000000..5b0e7d8e9f --- /dev/null +++ b/app/assets/javascripts/discourse/routes/tags-intersection.js.es6 @@ -0,0 +1,9 @@ +import TagsShowRoute from 'discourse/routes/tags-show'; + +export default TagsShowRoute.extend({}); + +// The tags-intersection route is exactly the same as the tags-show route, but the wildcard at the +// end of the route (*additional_tags) will cause a match when query parameters are present, +// breaking all other tags-show routes. Ember thinks the query params are addition tags and should +// be handled by the intersection logic. Defining tags-intersection as something separate avoids +// that confusion.