From ba7785eaa08d302f21daabaa7fcbeb007e574059 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 21 May 2021 18:53:44 +0530 Subject: [PATCH] fix: Don't strip 'app' from doctype route names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After creation of a new document and going back would break routes for doctypes that start with 'App'. In observed instance, it would clips the “app” portion in the appraisal and appraisal-template. --- frappe/public/js/frappe/router.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/router.js b/frappe/public/js/frappe/router.js index 5378294855..12caf4ab94 100644 --- a/frappe/public/js/frappe/router.js +++ b/frappe/public/js/frappe/router.js @@ -372,7 +372,8 @@ frappe.router = { strip_prefix(route) { if (route.substr(0, 1)=='/') route = route.substr(1); // for /app/sub - if (route.startsWith('app')) route = route.substr(4); // for desk/sub + if (route.startsWith('app/')) route = route.substr(4); // for desk/sub + if (route == 'app') route = route.substr(4); // for /app if (route.substr(0, 1)=='/') route = route.substr(1); if (route.substr(0, 1)=='#') route = route.substr(1); if (route.substr(0, 1)=='!') route = route.substr(1);