From d4daf24f4d8886e93d43afabf062751f14a4bcb9 Mon Sep 17 00:00:00 2001 From: Martin Renvoize 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 2396c3681c5..f8a4a331bd5 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 @@ + @@ -1092,6 +1093,7 @@ + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 26071e7a485..101db104a35 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 @@ + @@ -1215,6 +1216,7 @@ + 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 @@ + -- 2.39.5