Bugzilla – Attachment 157313 Details for
Bug 34020
Sequence of MARC 264 subfields different on XSLT result list and detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34020: Preserve order of subfields in 264 display
Bug-34020-Preserve-order-of-subfields-in-264-displ.patch (text/plain), 7.82 KB, created by
Owen Leonard
on 2023-10-18 13:02:21 UTC
(
hide
)
Description:
Bug 34020: Preserve order of subfields in 264 display
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-10-18 13:02:21 UTC
Size:
7.82 KB
patch
obsolete
>From c2ab1002bf7262aa4bec73bc92ffe5e441a723c3 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 18 Oct 2023 12:00:05 +0000 >Subject: [PATCH] Bug 34020: Preserve order of subfields in 264 display > >When ordered $a$b$a$b$c in the MARC object, 264 subfields are displayed >$a$a$b$b$c. This goes against the standard. > >This patch preserves the order. > >1) Edit a record and add/update a 264 fields to have subfields a, b, a, > b, c in that order >1) Search for record in staff and opac, see subfields displayed in > order "aabbc" in results >2) View the details page for the record in staff and opac, note same > order >3) Apply the patch, restart all >4) Confirm staff and opac, results and details now follow the order of > the subfields in the record's field > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/xslt/MARC21slimUtils.xsl | 59 ++++++++----------- > .../bootstrap/en/xslt/MARC21slimUtils.xsl | 58 ++++++++---------- > 2 files changed, 52 insertions(+), 65 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 3c3cecb6ff..5da84927a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -281,41 +281,34 @@ > </xsl:when> > </xsl:choose> > >- <xsl:if test="$field/marc:subfield[@code='a']"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">a</xsl:with-param> >- </xsl:call-template> >- </xsl:if> >- <xsl:text> </xsl:text> >- >- <xsl:choose> >- <xsl:when test="$url='1'"> >- <xsl:if test="$field/marc:subfield[@code='b']"> >- <a> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Provider:<xsl:value-of select="str:encode-uri($field/marc:subfield[@code='b'], true())"/></xsl:attribute> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">b</xsl:with-param> >- </xsl:call-template> >- </a> >- </xsl:if> >- </xsl:when> >- <xsl:otherwise> >- <xsl:if test="$field/marc:subfield[@code='b']"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">b</xsl:with-param> >- </xsl:call-template> >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="@code='a'"> >+ <xsl:value-of select="current()"/> >+ </xsl:if> >+ <xsl:if test="@code='b'"> >+ <xsl:choose> >+ <xsl:when test="$url='1'"> >+ <a> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Provider:<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> >+ <xsl:value-of select="current()"/> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="current()"/> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:if> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:text> </xsl:text> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">c</xsl:with-param> >+ <xsl:if test="@code='c'"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:value-of select="current()"/> >+ </xsl:with-param> > </xsl:call-template> >- </xsl:with-param> >- </xsl:call-template> >- >+ </xsl:if> >+ <xsl:if test="position() != last()"> >+ <xsl:text> </xsl:text> >+ </xsl:if> >+ </xsl:for-each> > </span> > </xsl:template> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >index b0a8ad1b59..62465adf27 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >@@ -279,40 +279,34 @@ > </xsl:when> > </xsl:choose> > >- <xsl:if test="$field/marc:subfield[@code='a']"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">a</xsl:with-param> >- </xsl:call-template> >- </xsl:if> >- <xsl:text> </xsl:text> >- >- <xsl:choose> >- <xsl:when test="$url='1'"> >- <xsl:if test="$field/marc:subfield[@code='b']"> >- <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri($field/marc:subfield[@code='b'], true())"/></xsl:attribute> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">b</xsl:with-param> >- </xsl:call-template> >- </a> >- </xsl:if> >- </xsl:when> >- <xsl:otherwise> >- <xsl:if test="$field/marc:subfield[@code='b']"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">b</xsl:with-param> >- </xsl:call-template> >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="@code='a'"> >+ <xsl:value-of select="current()"/> >+ </xsl:if> >+ <xsl:if test="@code='b'"> >+ <xsl:choose> >+ <xsl:when test="$url='1'"> >+ <a> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> >+ <xsl:value-of select="current()"/> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="current()"/> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:if> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:text> </xsl:text> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">c</xsl:with-param> >+ <xsl:if test="@code='c'"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:value-of select="current()"/> >+ </xsl:with-param> > </xsl:call-template> >- </xsl:with-param> >- </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="position() != last()"> >+ <xsl:text> </xsl:text> >+ </xsl:if> >+ </xsl:for-each> > </span> > </xsl:template> > >-- >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 34020
:
157307
|
157308
|
157313
|
157314
|
157317
|
157318
|
157319