Bug 27178 - OPAC results and lists pages contain invalid attributes (xmlns:str="http://exslt.org/strings")
Summary: OPAC results and lists pages contain invalid attributes (xmlns:str="http://ex...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 14441
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-09 14:52 UTC by Henry Bolshaw
Modified: 2021-02-11 22:28 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02,20.05.08


Attachments
Bug 27178: Add 'str' namespace to exclude-result-prefixes (2.73 KB, patch)
2020-12-10 10:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27178: Add 'str' namespace to exclude-result-prefixes (2.79 KB, patch)
2020-12-10 13:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27178: Add 'str' namespace to exclude-result-prefixes (2.85 KB, patch)
2020-12-23 15:58 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Bolshaw 2020-12-09 14:52:48 UTC
The <p> and <a> elements on the OPAC search results pages (opac-search.pl) and lists pages (opac-shelves.pl) contain invalid attributes: "xmlns:str="http://exslt.org/strings"

These seem to be leaking through from the XSLT.

For example: 

<a xmlns:str="http://exslt.org/strings" href="/cgi-bin/koha/opac-detail.pl?biblionumber=18566&amp;query_desc=kw%2Cwrdl%3A%20spin" class="title"><span class="term">Spin</span> a silver dollar; story of a desert trading-post; illus. with color reproductions of the work of the Navaho boy artist, Little No-Shirt (Beatien Yazz). </a>
Comment 1 Jonathan Druart 2020-12-09 15:03:30 UTC
It might come from a exslt change. If I have only the "include" in MARC21slim2OPACResults.xsl I am seeing different nodes getting this attribute.

xmlns:str="http://exslt.org/strings"
Comment 2 Jonathan Druart 2020-12-10 10:41:22 UTC
Created attachment 114298 [details] [review]
Bug 27178: Add 'str' namespace to exclude-result-prefixes

Some nodes in the generated HTML document contain the 'str' namespace.
For instance, at the OPAC on the search result list, you can see:
<a xmlns:str="http://exslt.org/strings" href="/cgi-bin/koha/opac-detail.pl?biblionumber=18566&amp;query_desc=kw%2Cwrdl%3A%20spin" class="title">

The solution is to add 'str' to exclude-result-prefixes.
From https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/stylesheet
"""
Specifies any namespace used in this document that should not be sent to the output document. The list is whitespace separated.
"""

Test plan:
0. Don't apply this patch
1. Launch a search at the OPAC
2. Inspect the title link for the records
=> Note the 'xmlns:str' attribute on tag "a"
3. Apply this patch
4. restart_all
5. Repeat 1. and 2.
=> Note that the attribute is gone now.

QA will check that no other occurrences is missing (note that one
NORMARC xsl is missing it, but NORMARC is deprecated)
Comment 3 Martin Renvoize 2020-12-10 13:20:25 UTC
Created attachment 114308 [details] [review]
Bug 27178: Add 'str' namespace to exclude-result-prefixes

Some nodes in the generated HTML document contain the 'str' namespace.
For instance, at the OPAC on the search result list, you can see:
<a xmlns:str="http://exslt.org/strings" href="/cgi-bin/koha/opac-detail.pl?biblionumber=18566&amp;query_desc=kw%2Cwrdl%3A%20spin" class="title">

The solution is to add 'str' to exclude-result-prefixes.
From https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/stylesheet
"""
Specifies any namespace used in this document that should not be sent to the output document. The list is whitespace separated.
"""

Test plan:
0. Don't apply this patch
1. Launch a search at the OPAC
2. Inspect the title link for the records
=> Note the 'xmlns:str' attribute on tag "a"
3. Apply this patch
4. restart_all
5. Repeat 1. and 2.
=> Note that the attribute is gone now.

QA will check that no other occurrences is missing (note that one
NORMARC xsl is missing it, but NORMARC is deprecated)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2020-12-10 13:20:41 UTC
Great work, well found Jonathan!
Comment 5 Nick Clemens 2020-12-23 15:58:02 UTC
Created attachment 114684 [details] [review]
Bug 27178: Add 'str' namespace to exclude-result-prefixes

Some nodes in the generated HTML document contain the 'str' namespace.
For instance, at the OPAC on the search result list, you can see:
<a xmlns:str="http://exslt.org/strings" href="/cgi-bin/koha/opac-detail.pl?biblionumber=18566&amp;query_desc=kw%2Cwrdl%3A%20spin" class="title">

The solution is to add 'str' to exclude-result-prefixes.
From https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/stylesheet
"""
Specifies any namespace used in this document that should not be sent to the output document. The list is whitespace separated.
"""

Test plan:
0. Don't apply this patch
1. Launch a search at the OPAC
2. Inspect the title link for the records
=> Note the 'xmlns:str' attribute on tag "a"
3. Apply this patch
4. restart_all
5. Repeat 1. and 2.
=> Note that the attribute is gone now.

QA will check that no other occurrences is missing (note that one
NORMARC xsl is missing it, but NORMARC is deprecated)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Jonathan Druart 2021-01-04 13:10:57 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 7 Fridolin Somers 2021-01-07 14:02:36 UTC
Pushed to 20.11.x for 20.11.02
Comment 8 Andrew Fuerste-Henry 2021-01-11 21:53:35 UTC
Pushed to 20.05.x for 20.05.8
Comment 9 Victor Grousset/tuxayo 2021-01-21 19:16:30 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.