Bug 30162: Fix staff interface link in OPAC XSLT files for 830$w
authorKatrin Fischer <katrin.fischer@bsz-bw.de>
Tue, 14 Feb 2023 09:36:45 +0000 (09:36 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 30 Mar 2023 10:10:59 +0000 (12:10 +0200)
All the links in the Utils files shoudl be built using the $searchurl
variable to adapt the link to either staff or OPAC.

To test:
* Enable UseControlNumber system preference
* Create a record with the following fields:

490 1 _ ‡aEffective software development series
830 _ 0 ‡aEffective software development series.‡w13736978

  $w can be anything for this use case or another $w from your catalog.
  Easiest might be to enable the Advanced cataloguing editor to be
  able to insert these lines easily. If you are using the sample data,
  the example shoudl work as is.

* Save the record and open it in the staff interface and the OPAC
* The link in the OPAC should be broken, staff should work
* Apply patch
* Now both links should work

Co-authored-by: Anke Bruns <Anke.Bruns@gwdg.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl

index d9a49ff..470a3f2 100644 (file)
         <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']">
             <xsl:choose>
                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                    <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
+                    <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="marc:subfield[@code='w']"/></xsl:attribute>
                         <xsl:call-template name="chopPunctuation">
                             <xsl:with-param name="chopString">
                                 <xsl:call-template name="subfieldSelect">
index e899b81..7e6e702 100644 (file)
         <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']">
             <xsl:choose>
                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                    <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
+                    <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="marc:subfield[@code='w']"/></xsl:attribute>
                         <xsl:call-template name="chopPunctuation">
                             <xsl:with-param name="chopString">
                                 <xsl:call-template name="subfieldSelect">