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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2026-02-10 17:59:00 +00:00 committed by Lucas Gass
parent f63a1d295f
commit ec0453354c
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
3 changed files with 5 additions and 0 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>