help3xsl/help2.js | 5 ++++- help3xsl/index2.html | 2 +- help3xsl/online_transform.xsl | 4 +++- source/text/shared/05/err_html.xhp | 17 +++++++++++++---- 4 files changed, 21 insertions(+), 7 deletions(-)
New commits: commit 456d9b054d29362667b0f3acc391c46293312751 Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Mon Jun 15 16:51:34 2020 -0300 Commit: Olivier Hallot <olivier.hal...@libreoffice.org> CommitDate: Wed Jun 17 01:32:48 2020 +0200 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.hal...@libreoffice.org> diff --git a/help3xsl/help2.js b/help3xsl/help2.js index 95635c846..f40492afb 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 b42007dd5..5e937f3e2 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 6df80b540..21d37d1b4 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> <!-- ################### diff --git a/source/text/shared/05/err_html.xhp b/source/text/shared/05/err_html.xhp index d4116f45a..446622431 100644 --- a/source/text/shared/05/err_html.xhp +++ b/source/text/shared/05/err_html.xhp @@ -28,10 +28,19 @@ </history> </meta> <body> -<paragraph role="heading" id="hd_id3146957" xml-lang="en-US" level="1">Could not find Help page.</paragraph> - <paragraph role="paragraph" id="par_id3147088" xml-lang="en-US">Unfortunately the Help page you selected was not found. The following data could be helpful in locating the error:</paragraph> +<h1 id="hd_id3146957">Could not find Help page (404).</h1> + <paragraph role="paragraph" id="par_id3147088" xml-lang="en-US">That is an error. Possible causes are:</paragraph> +<list type="unordered"> + <listitem> + <paragraph id="par_id131592238966436" role="listitem">The page does not exists and must be created.</paragraph> + </listitem> + <listitem> + <paragraph id="par_id201592238985883" role="listitem">The page exists, but the Help ID is wrong or missing.</paragraph> + </listitem> +</list> +<paragraph role="paragraph" id="par_id761592239118086">Use the Module, Contents, Index and Search selectors to find the right page.</paragraph> + +<paragraph role="paragraph" id="par_id971592240070356">The following data could be helpful in locating the error:</paragraph> <paragraph role="paragraph" id="par_id3143268" xml-lang="en-US">Help ID: <emph><help-id-missing/></emph></paragraph> - <paragraph role="paragraph" id="par_idN10681" xml-lang="en-US">You can install missing Help modules using the <emph>Setup</emph> application.</paragraph> - <paragraph role="paragraph" id="par_id3150541" xml-lang="en-US">Click <image id="img_id3148946" src="res/sc06301.png" width="0.222inch" height="0.222inch"><alt id="alt_id3148946" xml-lang="en-US">Icon</alt></image><emph>Back</emph> to return to the previous page.</paragraph> </body> </helpdocument> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits