From 1d49dbdf962c1f083e597a64cbadb5c4beb95bdc Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Mon, 16 Feb 2026 09:27:07 +0000 Subject: [PATCH] Bug 6892: (follow-up) Fix urls in OPAC when TrackClicks is enabled This patch fixes outgoing links from 856$u when system preference 'TrackClicks' is set and the URL is lacking the protocol prefix. Test plan: a) set system pref TrackClicks to 'Track' or 'Track anonymously' b) edit a record (f.e. 262) and set the following 856 fields (the record from 1st patch is sufficient though): 1. 856 ind1=4 $u = example.com 2. 856 $u = example.com 3. 856 $u = https://example.com b) save and search for that record in OPAC. c) on search results list (opac-search.pl) please check the links on that record: 1. links to http://main.localhost/cgi-bin/koha/tracklinks.pl?uri=example.com&biblionumber=262 and does not work 2. links to http://main.localhost/cgi-bin/koha/tracklinks.pl?uri=example.com&biblionumber=262 and does not work 3. links to http://main.localhost/cgi-bin/koha/tracklinks.pl?uri=https://example.com&biblionumber=262 and works d) click on the record to get to the detail page (opac-detail.pl) and check the links again (Online resources). They should be the same as in step c) e) apply patch, call restart_all and redo step b) until d) verifying that 1. is now prefixed with http:// and links to http://main.localhost/cgi-bin/koha/tracklinks.pl?uri=http://example.com&biblionumber=262 (works now) 2. is now prefixed with http:// and links to http://main.localhost/cgi-bin/koha/tracklinks.pl?uri=http://example.com&biblionumber=262 (works now) 3. still links to http://main.localhost/cgi-bin/koha/tracklinks.pl?uri=https://example.com&biblionumber=262 Signed-off-by: David Nind --- .../bootstrap/en/xslt/MARC21slimUtils.xsl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl index 4f49f8661b..a93b5da5d8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl @@ -705,23 +705,26 @@ + + + + + + + +
  • - /cgi-bin/koha/tracklinks.pl?uri=&biblionumber= + /cgi-bin/koha/tracklinks.pl?uri=&biblionumber= - /cgi-bin/koha/tracklinks.pl?uri=&biblionumber= + /cgi-bin/koha/tracklinks.pl?uri=&biblionumber= - - - - - - + -- 2.39.5