From cd18d947a7d002dd7a348dbdcaf126dbfa0e488d Mon Sep 17 00:00:00 2001 From: "hasnain2808@gmail.com" Date: Wed, 31 Mar 2021 13:01:33 +0530 Subject: [PATCH] fix: use pathname on window.location --- frappe/public/js/frappe/router.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frappe/public/js/frappe/router.js b/frappe/public/js/frappe/router.js index 249d3414e9..5378294855 100644 --- a/frappe/public/js/frappe/router.js +++ b/frappe/public/js/frappe/router.js @@ -364,7 +364,7 @@ frappe.router = { // return clean sub_path from hash or url // supports both v1 and v2 routing if (!route) { - route = window.location.hash || window.location.pathname; + route = window.location.hash || (window.location.pathname + window.location.search); } return this.strip_prefix(route); @@ -389,8 +389,6 @@ frappe.router = { set_route_options_from_url(route) { // set query parameters as frappe.route_options var last_part = route[route.length - 1]; - // add routing v2 compatability - if (!last_part.includes("?")) last_part = route[route.length - 1] + window.location.search; if (last_part.indexOf("?") < last_part.indexOf("=")) { // has ? followed by = let parts = last_part.split("?");