From 9df96fa03b73513ded6163de7d08afc318c61575 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 23 Jul 2024 12:56:48 +0200 Subject: Don't modify address bar when loading help topic. Modifying the current URL like this causes several problems, and is imo bad practice. When requesting a help topic without specifying the language in the URL (like `help/member/member_guide`) the locale for the current channel is used to fetch the topic. On the other hand, if fetching a topic with the language in the URL, the detected language will be used. Since the channel locale may not match the locale supported by the help system, weird situations may arise. I.e. fetching the topic without language in the URL works, but as the URL has now been rewritten, reloading the page will fail with a 404 status. Being a bit less clever solves this issue, and leaves the web browser to behave more as expected by the user. --- view/js/mod_help.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'view') diff --git a/view/js/mod_help.js b/view/js/mod_help.js index 9c3591498..b87e300fa 100644 --- a/view/js/mod_help.js +++ b/view/js/mod_help.js @@ -97,8 +97,6 @@ $(document).ready(function () { } } - // Update the address bar to reflect the loaded language - window.history.replaceState({}, '', '/' + pathParts.join('/')); // Highlight the language in the language selector that is currently viewed $('.lang-selector').find('.lang-choice:contains("' + help_language + '")').addClass('active'); -- cgit v1.2.3