Bugzilla – Attachment 145999 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.62 KB, created by
Nick Clemens (kidclamp)
on 2023-02-02 13:33:56 UTC
(
hide
)
Description:
Bug 32794: Expand tests for access method in XLST files
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-02-02 13:33:56 UTC
Size:
8.62 KB
patch
obsolete
>From ede3af6d069dc8944117dc379ff24c94c7bc495d 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 > >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 >--- > .../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 53c5be864b..e8e90a47bd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1166,14 +1166,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