FIX: handle permalinks with query parameters (#12700)

FIX: handle permalinks with query parameters (#12700)

diff --git a/app/assets/javascripts/discourse/app/routes/unknown.js b/app/assets/javascripts/discourse/app/routes/unknown.js
index 81eafa6..5f74049 100644
--- a/app/assets/javascripts/discourse/app/routes/unknown.js
+++ b/app/assets/javascripts/discourse/app/routes/unknown.js
@@ -3,8 +3,9 @@ import DiscourseURL from "discourse/lib/url";
 import { ajax } from "discourse/lib/ajax";
 
 export default DiscourseRoute.extend({
-  model(params, transition) {
-    const path = params.path;
+  model(_, transition) {
+    const path = transition.intent.url;
+
     return ajax("/permalink-check.json", {
       data: { path },
     }).then((results) => {
diff --git a/app/assets/javascripts/discourse/tests/acceptance/unknown-test.js b/app/assets/javascripts/discourse/tests/acceptance/unknown-test.js
index 7910e93..3f8dba0 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/unknown-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/unknown-test.js
@@ -26,8 +26,8 @@ acceptance("Category 404", function (needs) {
 
 acceptance("Unknown", function (needs) {
   const urls = {
-    "viewtopic.php": "/t/internationalization-localization/280",
-    "not-the-url-for-faq": "/faq",
+    "/viewtopic.php?f=8&t=280": "/t/internationalization-localization/280",
+    "/another-url-for-faq": "/faq",
   };
 
   needs.pretender((server, helper) => {
@@ -59,7 +59,7 @@ acceptance("Unknown", function (needs) {
   });
 
   test("Permalink URL to a static page", async function (assert) {
-    await visit("/not-the-url-for-faq");
+    await visit("/another-url-for-faq");
     assert.equal(currentURL(), "/faq");
   });
 });

GitHub sha: c1fc2a1e

This commit appears in #12700 which was approved by CvX. It was merged by ZogStriP.