Bug 23383: fix IdRef syspref test in XSLT
authorFridolin Somers <fridolin.somers@biblibre.com>
Fri, 26 Jul 2019 13:43:02 +0000 (15:43 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 16 Mar 2020 10:42:02 +0000 (10:42 +0000)
IdRef link is displayed via XSLT.
There is a test of syspref with just if value is defined.
But in installer/data/mysql/sysprefs.sql you see this pref will be 0 by default, which is true in XPATH.
We should test that pref is 1.

Test plan :
1) Create a fresh UNIMARC database
2) You have pref IdRef disabled
3) Simulate a SUDOC record:
  Fill a 7..$3 field with a ppn (032581270 for example).
  Fill the 009 field with an integer
4) Go to the opac detail page of the record => You don't see IdRef link
5) Enable IdRef syspref
6) Go to the opac detail page of the record => You see IdRef link
7) Disable IdRef syspref
8) Go to the opac detail page of the record => You don't see IdRef link

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl

index 61f67eb..b14b93f 100644 (file)
                 </xsl:if>
               </xsl:for-each>
             </a>
-            <xsl:if test="$IdRef">
+            <xsl:if test="$IdRef = '1'">
               <xsl:if test="marc:subfield[@code=3]">
                 <xsl:text> </xsl:text>
                 <a>