Bugzilla – Attachment 148565 Details for
Bug 32794
mailto links in 856 can be incorrectly formed by XSLT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32794: Expand tests for access method in XLST files
Bug-32794-Expand-tests-for-access-method-in-XLST-f.patch (text/plain), 8.77 KB, created by
Marcel de Rooy
on 2023-03-22 16:00:48 UTC
(
hide
)
Description:
Bug 32794: Expand tests for access method in XLST files
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-03-22 16:00:48 UTC
Size:
8.77 KB
patch
obsolete
>From 9b2e4630d9a4ee5586081912e7b0a1af5858ef80 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 2 Feb 2023 13:29:04 +0000 >Subject: [PATCH] Bug 32794: Expand tests for access method in XLST files >Content-Type: text/plain; charset=utf-8 > >This patch expands the checks for 856u to check for mailto, and adds a few conditiona >checks of the first indicator to cover more methods > >Reference: https://www.oclc.org/bibformats/en/8xx/856.html > >To test: >1 - Edit a record and add a few 856 fields: > 856 0 0 $umailto:test@example.org > 856 0 0 $utest@example.org > 856 2 0 $utelnet://pucc.princeton.edu > 856 2 0 $upucc.princeton.edu > 856 3 0 $u8885555555 >2 - View staff details and results and opac details and results >3 - Note all links have been prepended with http:// >4 - Apply patch >5 - Refresh all views, ensure links are correctly formed > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 11 ++++++++++- > .../prog/en/xslt/MARC21slim2intranetResults.xsl | 11 ++++++++++- > .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 11 ++++++++++- > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 11 ++++++++++- > 4 files changed, 40 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index c5fd064e63..661d61adb2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -927,14 +927,23 @@ > <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> > <a> > <xsl:attribute name="href"> >- <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >+ <xsl:if test="not(contains(marc:subfield[@code='u'],'://') or contains(marc:subfield[@code='u'],'mailto:'))"> > <xsl:choose> > <xsl:when test="@ind1=7"> > <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=0"> >+ <xsl:text>mailto:</xsl:text> >+ </xsl:when> > <xsl:when test="@ind1=1"> > <xsl:text>ftp://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=2"> >+ <xsl:text>telnet://</xsl:text> >+ </xsl:when> >+ <xsl:when test="@ind1=3"> >+ <xsl:text>tel:</xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>http://</xsl:text> > </xsl:otherwise> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index fa94894870..902751ad80 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -963,14 +963,23 @@ > <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> > <a> > <xsl:attribute name="href"> >- <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >+ <xsl:if test="not(contains(marc:subfield[@code='u'],'://') or contains(marc:subfield[@code='u'],'mailto:'))"> > <xsl:choose> > <xsl:when test="@ind1=7"> > <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=0"> >+ <xsl:text>mailto:</xsl:text> >+ </xsl:when> > <xsl:when test="@ind1=1"> > <xsl:text>ftp://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=2"> >+ <xsl:text>telnet://</xsl:text> >+ </xsl:when> >+ <xsl:when test="@ind1=3"> >+ <xsl:text>tel:</xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>http://</xsl:text> > </xsl:otherwise> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index 34a6e0bbf7..429ad70d67 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -1046,14 +1046,23 @@ > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href"> >- <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >+ <xsl:if test="not(contains(marc:subfield[@code='u'],'://') or contains(marc:subfield[@code='u'],'mailto:'))"> > <xsl:choose> > <xsl:when test="@ind1=7"> > <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=0"> >+ <xsl:text>mailto:</xsl:text> >+ </xsl:when> > <xsl:when test="@ind1=1"> > <xsl:text>ftp://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=2"> >+ <xsl:text>telnet://</xsl:text> >+ </xsl:when> >+ <xsl:when test="@ind1=3"> >+ <xsl:text>tel:</xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>http://</xsl:text> > </xsl:otherwise> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 9e7a16a2bb..ffd4e264d4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1176,14 +1176,23 @@ > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href"> >- <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >+ <xsl:if test="not(contains(marc:subfield[@code='u'],'://') or contains(marc:subfield[@code='u'],'mailto:'))"> > <xsl:choose> > <xsl:when test="@ind1=7"> > <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=0"> >+ <xsl:text>mailto:</xsl:text> >+ </xsl:when> > <xsl:when test="@ind1=1"> > <xsl:text>ftp://</xsl:text> > </xsl:when> >+ <xsl:when test="@ind1=2"> >+ <xsl:text>telnet://</xsl:text> >+ </xsl:when> >+ <xsl:when test="@ind1=3"> >+ <xsl:text>tel:</xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>http://</xsl:text> > </xsl:otherwise> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32794
:
145999
|
147745
| 148565 |
148566
|
148567