help3xsl/help.js |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 143eb86de536e863170222617485c3e7f41d628a
Author:     Ilmari Lauhakangas <[email protected]>
AuthorDate: Fri Jan 14 21:40:03 2022 +0200
Commit:     Olivier Hallot <[email protected]>
CommitDate: Fri Jan 14 21:40:50 2022 +0100

    Related tdf#123318 Fix filtering with SHARED
    
    Change-Id: Ic704b5ddcc0448a884da4ca01fa54bb94692495f
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/128423
    Tested-by: Jenkins
    Reviewed-by: Rafael Lima <[email protected]>
    Reviewed-by: Olivier Hallot <[email protected]>

diff --git a/help3xsl/help.js b/help3xsl/help.js
index 6adbf2e17..458c382dd 100644
--- a/help3xsl/help.js
+++ b/help3xsl/help.js
@@ -52,15 +52,15 @@ function currentModule() {
     // We need to know the module that the user is using when they call for 
help
     var module = getQuery('DbPAR');
     if (module == null) {
-        // get the module name from the URL and remove the first character,
-        // but first deal with snowflake Base
+        // first deal with snowflake Base
         if(url.indexOf('explorer/database/') !== -1) {
             module = 'BASE';
         } else {
-            if (null === regexArray){// comes from search or elsewhere, no 
defined module in URL
-                module = 'HARED'
+            if (null === regexArray){
+                // comes from search or elsewhere, no defined module in URL
+                module = 'SHARED'
             } else {
-                module = regexArray[1].toUpperCase().substring(1);
+                module = regexArray[1].toUpperCase();
             }
         }
     }
@@ -69,7 +69,7 @@ function currentModule() {
 function fullLinkify(indexEl, bookmarks, modules, currentModule) {
     var fullLinkified = '';
     // if user is not on a shared category page, limit the index to the 
current module + shared
-    if(currentModule !== 'HARED') {
+    if(currentModule !== 'SHARED') {
         bookmarks = bookmarks.filter(function(obj) {
             return obj['app'] === currentModule || obj['app'] === 'SHARED';
         });
@@ -114,7 +114,7 @@ function filter(indexList) {
 
     // Similarly to fullLinkify(), limit search results to the user's current 
module + shared
     // unless they're somehow not coming from a module.
-    if(userModule !== 'HARED') {
+    if(userModule !== 'SHARED') {
         resultModules = [userModule, 'SHARED'];
     } else {
         resultModules = modules;

Reply via email to