Bugzilla – Attachment 148567 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: (follow-up) Replace code by new function (template)
Bug-32794-follow-up-Replace-code-by-new-function-t.patch (text/plain), 10.55 KB, created by
Marcel de Rooy
on 2023-03-22 16:00:53 UTC
(
hide
)
Description:
Bug 32794: (follow-up) Replace code by new function (template)
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-03-22 16:00:53 UTC
Size:
10.55 KB
patch
obsolete
>From 83be704f87ba529be2180537e4e9061541f612a6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 22 Mar 2023 15:50:45 +0000 >Subject: [PATCH] Bug 32794: (follow-up) Replace code by new function > (template) >Content-Type: text/plain; charset=utf-8 > >Test plan: >Same as first patch. >Bonus: >Remove protocol from $u. Set first ind1 to 7. >Put mailto in $2. Check link. >Change $2 to tel. Check link. >Change $2 to https. Check link. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../en/xslt/MARC21slim2intranetDetail.xsl | 27 ++++--------------- > .../en/xslt/MARC21slim2intranetResults.xsl | 27 ++++--------------- > .../en/xslt/MARC21slim2OPACDetail.xsl | 27 ++++--------------- > .../en/xslt/MARC21slim2OPACResults.xsl | 27 ++++--------------- > 4 files changed, 20 insertions(+), 88 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 661d61adb2..9e40d4f55d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -927,28 +927,11 @@ > <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'],'://') 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> >- </xsl:choose> >- </xsl:if> >+ <xsl:call-template name="AddMissingProtocol"> >+ <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >+ <xsl:with-param name="indicator1" select="@ind1"/> >+ <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >+ </xsl:call-template> > <xsl:value-of select="marc:subfield[@code='u']"/> > </xsl:attribute> > <xsl:choose> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index 902751ad80..f91a243b16 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -963,28 +963,11 @@ > <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'],'://') 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> >- </xsl:choose> >- </xsl:if> >+ <xsl:call-template name="AddMissingProtocol"> >+ <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >+ <xsl:with-param name="indicator1" select="@ind1"/> >+ <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >+ </xsl:call-template> > <xsl:value-of select="marc:subfield[@code='u']"/> > </xsl:attribute> > <xsl:choose> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index 429ad70d67..40215185a5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -1046,28 +1046,11 @@ > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href"> >- <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> >- </xsl:choose> >- </xsl:if> >+ <xsl:call-template name="AddMissingProtocol"> >+ <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >+ <xsl:with-param name="indicator1" select="@ind1"/> >+ <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >+ </xsl:call-template> > <xsl:value-of select="marc:subfield[@code='u']"/> > </xsl:attribute> > </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 ffd4e264d4..36026bdc0d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1176,28 +1176,11 @@ > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href"> >- <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> >- </xsl:choose> >- </xsl:if> >+ <xsl:call-template name="AddMissingProtocol"> >+ <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >+ <xsl:with-param name="indicator1" select="@ind1"/> >+ <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >+ </xsl:call-template> > <xsl:value-of select="marc:subfield[@code='u']"/> > </xsl:attribute> > </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