martin
(Martin Brennan)
February 25, 2026, 2:49am
12
This was interesting, if I went directly to one of the old URLs with a query ID it would work but if I clicked a link with that URL it would dump me on /queries . Fix is here:
main ← issue/fix-de-query-link-click
merged 03:31AM - 25 Feb 26 UTC
Followup 174ad83901a6641248de133d267dc6ae2364d818
We had the empty route file… `plugins/discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins/explorer/queries.js`
in the PR for the above commit but removed it before merge....
however it was actually necessary to properly redirect
old DE query links (not a direct URL in the browser address bar)
to the new query page e.g. `/admin/plugins/explorer/queries/:id`
to `/admin/plugins/discourse-data-explorer/queries/:id`
This commit adds the empty route file back to make this work.
The root cause here is that when Ember's resolver looks up a route
handler for `adminPlugins.explorer.queries`, it searches for a module with
the suffix routes `/admin-plugins/explorer/queries`. Since no file
queries.js exists at that path, the resolver's suffix trie falls back to
`routes/admin-plugins/explorer/queries/index` — finding queries/index.js
and using its class (`AdminPluginsExplorerQueriesIndexRoute`) as the
handler for the parent queries route.
This means when the router transitions to
`adminPlugins.explorer.queries.details` it first enters the parent
queries route, which runs the index handler's `beforeModel` —
redirecting to `/admin/plugins/discourse-data-explorer/queries` and
aborting the transition before the details route is ever reached.
2 Likes