Bugzilla – Attachment 192922 Details for
Bug 38096
Field 857 is not considered for display on XSLT files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38096: (follow-up) Fix missing biblionumber parameter in renderMARCOnlineResourceField
Bug-38096-follow-up-Fix-missing-biblionumber-param.patch (text/plain), 4.97 KB, created by
Pedro Amorim
on 2026-02-10 18:21:47 UTC
(
hide
)
Description:
Bug 38096: (follow-up) Fix missing biblionumber parameter in renderMARCOnlineResourceField
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2026-02-10 18:21:47 UTC
Size:
4.97 KB
patch
obsolete
>From adbe6f94270ac4de5b578aa985e99e1f62eea31c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Tue, 10 Feb 2026 17:59:00 +0000 >Subject: [PATCH] Bug 38096: (follow-up) Fix missing biblionumber parameter in > renderMARCOnlineResourceField > >The renderMARCOnlineResourceField template uses $biblionumber for the >TrackClicks feature but this parameter was never declared in the template >definition nor passed by any of the call sites. > >This caused XSLT runtime errors when TrackClicks system preference is >enabled ('track' or 'anonymous') and records contain MARC fields 856 or >857 with subfield $u (URLs): > > Variable 'biblionumber' has not been declared. > Undefined variable > XPath evaluation returned no result. > >This patch: >1. Adds biblionumber parameter to renderMARCOnlineResourceField template >2. Passes biblionumber value in all 4 call sites (2 in Detail, 2 in Results) > >Test plan: >1. Enable TrackClicks: System Preferences > OPAC > TrackClicks = "track" >2. Find a bibliographic record with field 856 or 857 containing subfield $u >3. Run: yarn build (to regenerate XSLT for all languages) >4. View the record in OPAC detail and search results pages >5. Verify no XSLT errors in plack-opac-error.log >6. Verify online resource links display correctly >7. Verify links include biblionumber parameter in tracklinks.pl URLs >--- > koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 2 ++ > .../opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 2 ++ > koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl | 1 + > 3 files changed, 5 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index 9f062315cd1..3e0d3a51b24 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -1075,6 +1075,7 @@ > <xsl:with-param name="OPACTrackClicks" select="$OPACTrackClicks"></xsl:with-param> > <xsl:with-param name="OPACURLOpenInNewWindow" select="$OPACURLOpenInNewWindow"></xsl:with-param> > <xsl:with-param name="screen" select="'detail'"></xsl:with-param> >+ <xsl:with-param name="biblionumber" select="$biblionumber"></xsl:with-param> > </xsl:call-template> > </ul> > </div> >@@ -1092,6 +1093,7 @@ > <xsl:with-param name="OPACTrackClicks" select="$OPACTrackClicks"></xsl:with-param> > <xsl:with-param name="OPACURLOpenInNewWindow" select="$OPACURLOpenInNewWindow"></xsl:with-param> > <xsl:with-param name="screen" select="'detail'"></xsl:with-param> >+ <xsl:with-param name="biblionumber" select="$biblionumber"></xsl:with-param> > </xsl:call-template> > </ul> > </div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 30ed9972b9e..200201b4795 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1198,6 +1198,7 @@ > <xsl:with-param name="OPACTrackClicks" select="$OPACTrackClicks"></xsl:with-param> > <xsl:with-param name="OPACURLOpenInNewWindow" select="$OPACURLOpenInNewWindow"></xsl:with-param> > <xsl:with-param name="screen" select="'results'"></xsl:with-param> >+ <xsl:with-param name="biblionumber" select="$biblionumber"></xsl:with-param> > </xsl:call-template> > </ul> > </div> >@@ -1215,6 +1216,7 @@ > <xsl:with-param name="OPACTrackClicks" select="$OPACTrackClicks"></xsl:with-param> > <xsl:with-param name="OPACURLOpenInNewWindow" select="$OPACURLOpenInNewWindow"></xsl:with-param> > <xsl:with-param name="screen" select="'results'"></xsl:with-param> >+ <xsl:with-param name="biblionumber" select="$biblionumber"></xsl:with-param> > </xsl:call-template> > </ul> > </div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >index 52392a1ea08..d09c8da4df8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >@@ -700,6 +700,7 @@ > <xsl:param name="OPACTrackClicks" /> > <xsl:param name="OPACURLOpenInNewWindow" /> > <xsl:param name="screen" /> >+ <xsl:param name="biblionumber" /> > > <xsl:for-each select="marc:datafield[@tag=$MARCOnlineResourceField and marc:subfield[@code='u']]"> > <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']" /></xsl:variable> >-- >2.39.5
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 38096
:
172466
|
172467
|
172468
|
172469
|
172470
|
172471
|
172532
|
172533
|
172534
|
172535
|
172536
|
192376
|
192377
|
192378
|
192379
|
192380
|
192381
|
192589
|
192590
|
192591
|
192592
|
192593
|
192594
|
192813
|
192814
|
192815
|
192816
|
192817
|
192818
|
192819
|
192906
|
192907
|
192908
|
192909
|
192910
|
192911
|
192919
|
192920
|
192921
| 192922 |
192966
|
193000