summaryrefslogtreecommitdiffstats
path: root/help3xsl
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2020-06-15 16:51:34 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2020-06-17 01:32:48 +0200
commit456d9b054d29362667b0f3acc391c46293312751 (patch)
tree8d6fc1f05a2a940d49a9ca1cdd9770442086d6e8 /help3xsl
parenttdf#129169 More adjustments in area/background (diff)
downloadhelp-456d9b054d29362667b0f3acc391c46293312751.tar.gz
help-456d9b054d29362667b0f3acc391c46293312751.zip
Add better 404 error
Missing help pages or links with bad HID were redirected to module entry page, masking the real issue in Help. This patch activated the 404 page and add HID information for debug and fix. Change-Id: I0d55f1c36d9a6c3fab0096d5e3cd171087729691 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/96401 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rw-r--r--help3xsl/help2.js5
-rw-r--r--help3xsl/index2.html2
-rw-r--r--help3xsl/online_transform.xsl4
3 files changed, 8 insertions, 3 deletions
diff --git a/help3xsl/help2.js b/help3xsl/help2.js
index 95635c8465..f40492afb1 100644
--- a/help3xsl/help2.js
+++ b/help3xsl/help2.js
@@ -232,9 +232,12 @@ if (document.body.getElementsByTagName('meta')) {
}
var module = getParameterByName("DbPAR");
-var helpID = getParameterByName("HID");
fixURL(module,system);
moduleColor(module);
+var helpID = getParameterByName("HID");
+// only used in xhp pages with <help-id-missing/> tags
+var missingElement = document.getElementById("bm_HID2");
+if(missingElement != null){missingElement.innerHTML = helpID;}
function debugInfo(dbg) {
if (dbg == null) return;
diff --git a/help3xsl/index2.html b/help3xsl/index2.html
index b42007dd5e..5e937f3e2c 100644
--- a/help3xsl/index2.html
+++ b/help3xsl/index2.html
@@ -53,7 +53,7 @@
}
// rebuild URL
if (file === undefined) {
- var newURL = lang + '/' + defaultFile + '?System=' + system + '&DbPAR=' + module;
+ var newURL = lang + '/text/shared/05/err_html.html?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark ;
} else {
var indx = file.indexOf('#');
var bm = file.substr(indx,file.length);
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 6df80b5405..21d37d1b4a 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -812,7 +812,9 @@
</xsl:template>
<!-- In case of missing help files -->
-<xsl:template match="help-id-missing"><xsl:value-of select="$Id"/></xsl:template>
+<xsl:template match="help-id-missing">
+<span id="bm_HID2"></span>
+</xsl:template>
<!--
###################