Bugzilla – Attachment 32938 Details for
Bug 12829
Incorrect ISBN visualization on the normal view if invalid/cancelled ISBN present
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12829: properly skip invalid ISBN when rendering for normal record display
SIGNED-OFF-Bug-12829-properly-skip-invalid-ISBN-wh.patch (text/plain), 11.40 KB, created by
Nicole C. Engard
on 2014-10-29 19:06:19 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12829: properly skip invalid ISBN when rendering for normal record display
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2014-10-29 19:06:19 UTC
Size:
11.40 KB
patch
obsolete
>From f76dab15b34cd965649fb2e53174d29876115488 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Wed, 29 Oct 2014 15:16:57 -0300 >Subject: [PATCH] [SIGNED-OFF] Bug 12829: properly skip invalid ISBN when rendering for normal record display > >Currently, 020$z (and 010$z fr UNIMARC) occurences are not shown, but the XSLT logic >used introduces punctuation characters for those $z occurences. > >This patch adds a check for the existence of subfield a, and only loops >on $a subfields. > >To test: >- Create/have a record with 020$z (or 010$z on UNIMARC) but no 020$a (no 010$a on UNIMARC). >- Open the detail page for the record (on both OPAC and staff). >=> FAIL: the ISBN label and ';' and '.' characters incorrectly shown. >- Repeat mixing with 020$a occurences to notice the bug. >- Apply the patch, reload >=> SUCCES: ISBN label shows only on the presence of a $a, and $z are skipped. > no matter how many ISBN fields you add. >- Sign off :-D > >Regards >To+ > >http://bugs.koha-community.org/show_bug.cgi?id=12901 >Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 25 +++++++++++----- > .../prog/en/xslt/NORMARCslim2intranetDetail.xsl | 25 +++++++++++----- > .../prog/en/xslt/UNIMARCslim2intranetDetail.xsl | 30 ++++++++++--------- > .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 26 ++++++++++------ > .../bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl | 25 +++++++++++----- > .../bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl | 26 +++++++++-------- > 6 files changed, 97 insertions(+), 60 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index e7bf6d1..d4ba67b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -390,14 +390,23 @@ > </span> > </xsl:if> > >- <xsl:if test="marc:datafield[@tag=020]"> >- <span class="results_summary isbn"><span class="label">ISBN: </span> >- <xsl:for-each select="marc:datafield[@tag=020]"> >- <xsl:variable name="isbn" select="marc:subfield[@code='a']"/> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> >- </xsl:for-each> >- </span> >+ <!-- Build ISBN --> >+ <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span class="results_summary isbn"><span class="label">ISBN: </span> >+ <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span property="isbn"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>; </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </span> >+ </xsl:for-each> >+ </span> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=022]"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >index 3271e5b..84aaabe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >@@ -306,14 +306,23 @@ > > <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=999]/marc:subfield[@code='c']}" ><!-- unAPI --></abbr> > >- <xsl:if test="marc:datafield[@tag=020]"> >- <span class="results_summary"><span class="label">ISBN: </span> >- <xsl:for-each select="marc:datafield[@tag=020]"> >- <xsl:variable name="isbn" select="marc:subfield[@code='a']"/> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> >- </xsl:for-each> >- </span> >+ <!-- Build ISBN --> >+ <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span class="results_summary isbn"><span class="label">ISBN: </span> >+ <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span property="isbn"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>; </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </span> >+ </xsl:for-each> >+ </span> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=022]"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl >index 552385e..fff7925 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl >@@ -142,21 +142,23 @@ > </li> > </xsl:if> > >+ <!-- Build ISBN --> > <xsl:if test="marc:datafield[@tag=010]/marc:subfield[@code='a']"> >- <li><strong>ISBN: </strong> >- <xsl:for-each select="marc:datafield[@tag=010]"> >- <xsl:variable name="isbn" select="marc:subfield[@code='a']"/> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:choose> >- <xsl:when test="position()=last()"> >- <xsl:text>.</xsl:text> >- </xsl:when> >- <xsl:otherwise> >- <xsl:text> ; </xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >- </li> >+ <span class="results_summary isbn"><span class="label">ISBN: </span> >+ <xsl:for-each select="marc:datafield[@tag=010]/marc:subfield[@code='a']"> >+ <span property="isbn"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>; </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </span> >+ </xsl:for-each> >+ </span> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=011]"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index a856823..9df73a3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -427,16 +427,22 @@ > </span> > </xsl:if> > >- <xsl:if test="marc:datafield[@tag=020]"> >- <span class="results_summary isbn"><span class="label">ISBN: </span> >- <xsl:for-each select="marc:datafield[@tag=020]"> >- <span property="isbn"> >- <xsl:variable name="isbn" select="marc:subfield[@code='a']"/> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> >- </span> >- </xsl:for-each> >- </span> >+ <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span class="results_summary isbn"><span class="label">ISBN: </span> >+ <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span property="isbn"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>; </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </span> >+ </xsl:for-each> >+ </span> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=022]"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >index e9fd625..1bd016f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >@@ -326,14 +326,23 @@ > > <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=999]/marc:subfield[@code='c']}" ><!-- unAPI --></abbr> > >- <xsl:if test="marc:datafield[@tag=020]"> >- <span class="results_summary"><span class="label">ISBN: </span> >- <xsl:for-each select="marc:datafield[@tag=020]"> >- <xsl:variable name="isbn" select="marc:subfield[@code='a']"/> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> >- </xsl:for-each> >- </span> >+ <!-- Build ISBN --> >+ <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span class="results_summary isbn"><span class="label">ISBN: </span> >+ <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']"> >+ <span property="isbn"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>; </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </span> >+ </xsl:for-each> >+ </span> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=022]"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >index f7d1984..e46038d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >@@ -190,20 +190,22 @@ > > <xsl:call-template name="tag_215" /> > >+ <!-- Build ISBN --> > <xsl:if test="marc:datafield[@tag=010]/marc:subfield[@code='a']"> > <span class="results_summary isbn"><span class="label">ISBN: </span> >- <xsl:for-each select="marc:datafield[@tag=010]"> >- <xsl:variable name="isbn" select="marc:subfield[@code='a']"/> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:choose> >- <xsl:when test="position()=last()"> >- <xsl:text>.</xsl:text> >- </xsl:when> >- <xsl:otherwise> >- <xsl:text> ; </xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >+ <xsl:for-each select="marc:datafield[@tag=010]/marc:subfield[@code='a']"> >+ <span property="isbn"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>; </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </span> >+ </xsl:for-each> > </span> > </xsl:if> > >-- >1.7.2.3
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 12829
:
31165
|
31166
|
31167
|
31168
|
31182
|
32936
|
32938
|
33273
|
33274