Bug 14441 - TrackClicks cuts off/breaks URLs
Summary: TrackClicks cuts off/breaks URLs
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Mason James
QA Contact: Testopia
URL:
Keywords:
: 11528 (view as bug list)
Depends on:
Blocks: 27178
  Show dependency treegraph
 
Reported: 2015-06-23 15:31 UTC by Katrin Fischer
Modified: 2020-12-10 10:31 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14441 - TrackClicks cuts off/breaks URLs (2.90 KB, patch)
2016-03-01 03:34 UTC, Mason James
Details | Diff | Splinter Review
Bug 14441 - TrackClicks cuts off/breaks URLs (2.87 KB, patch)
2016-03-01 03:48 UTC, Mason James
Details | Diff | Splinter Review
[SIGNED OFF] Bug 14441 - TrackClicks cuts off/breaks URLs (3.00 KB, patch)
2016-03-01 07:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 14441: TrackClicks cuts off/breaks URLs (XSLT) (9.19 KB, patch)
2016-03-01 12:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 14441: TrackClicks cuts off/breaks URLs (XSLT) (9.27 KB, patch)
2016-03-01 22:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 14441 - TrackClicks cuts off/breaks URLs (3.04 KB, patch)
2016-03-24 21:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 14441: TrackClicks cuts off/breaks URLs (XSLT) (9.26 KB, patch)
2016-03-24 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2015-06-23 15:31:55 UTC
I did a quick test with the TrackClicks preference and it appears to break URLs with multiple parameters? The second URL parameter is cut of for the links I looked at:

Without TrackClicks:
http://<domain_external>?identifier=1003033849-9-1373538128402-3&field=ALLEGROID

With TrackClicks set to track anonymously:

URL visible in the OPAC:
https://<domain_opac>/cgi-bin/koha/tracklinks.pl?uri=
http://<domain_external>?identifier=1003033849-9-1373538128402-3&field=ALLEGROID;biblionumber=2647

URL it tries to access:
http://<domain_external>?identifier=1003033849-9-1373538128402-3 
... will result in an error message in this case as an important bit is missing.
Comment 1 Mason James 2016-03-01 02:26:28 UTC
(In reply to Katrin Fischer from comment #0)
> I did a quick test with the TrackClicks preference and it appears to break
> URLs with multiple parameters? The second URL parameter is cut of for the
> links I looked at:
> 
> Without TrackClicks:
> http://<domain_external>?identifier=1003033849-9-1373538128402-
> 3&field=ALLEGROID
> 
> With TrackClicks set to track anonymously:
> 
> URL visible in the OPAC:
> https://<domain_opac>/cgi-bin/koha/tracklinks.pl?uri=
> http://<domain_external>?identifier=1003033849-9-1373538128402-
> 3&field=ALLEGROID;biblionumber=2647
> 
> URL it tries to access:
> http://<domain_external>?identifier=1003033849-9-1373538128402-3 
> ... will result in an error message in this case as an important bit is
> missing.

Oops, I just bumped into this too. I'll take a look now...
Comment 2 Mason James 2016-03-01 03:34:06 UTC Comment hidden (obsolete)
Comment 3 Mason James 2016-03-01 03:48:38 UTC Comment hidden (obsolete)
Comment 4 Mason James 2016-03-01 04:08:21 UTC
Comment on attachment 48484 [details] [review]
Bug 14441 - TrackClicks cuts off/breaks URLs

oops
Comment 5 Katrin Fischer 2016-03-01 07:03:57 UTC
Hm, I tested with 856 first, which is still broken, but this is a first partial fix.

My test was with a search URL from the Koha OPAC:

http://localhost:8080/cgi-bin/koha/catalogue/search.pl?idx=kw&q=der&sort_by=relevance_dsc&limit=su-to:Zeitschrift 
(kw: der and limit to one of the topic subjects)

It will work for items with the patch, but not for the regular URL field in the bibliographic record.
Comment 6 Katrin Fischer 2016-03-01 07:05:51 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2016-03-01 07:23:47 UTC
Fixing the URL encoding in the XSLT template is looking to be a lot harder, then fixing the problem in the templates :(
Comment 8 Jonathan Druart 2016-03-01 12:14:26 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2016-03-01 22:28:33 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2016-03-24 21:01:26 UTC
Created attachment 49556 [details] [review]
Bug 14441 - TrackClicks cuts off/breaks URLs

to test...

1/ set TrackClicks syspref to 'track'

2/ add a problematic multipart url to an item's 'url' field
    example url: http://foo.corg?key1=val1&key2=val2

3/ test url in opac-detail.pl - url is corrupt

4/ apply patch - url is corrct

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Only fixes the item URLs - a follow-up for the URLs
in the bibliographic record (856 for MARC21) is still
needed.
Comment 11 Katrin Fischer 2016-03-24 21:02:08 UTC
Created attachment 49557 [details] [review]
Bug 14441: TrackClicks cuts off/breaks URLs (XSLT)

Same test plan as previous patch, but for opac defail and result using
the XSLT views.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I am amazed!
Comment 12 Katrin Fischer 2016-03-24 21:02:43 UTC
Rebased - fixed conflict with the recent security fix in the first patch.
Comment 13 Brendan Gallagher 2016-03-24 21:03:29 UTC
Pushed to Master - Should be in the May 2016 release. Thanks!
Comment 14 Katrin Fischer 2016-03-24 21:59:11 UTC
*** Bug 11528 has been marked as a duplicate of this bug. ***
Comment 15 Julian Maurice 2016-04-06 13:57:17 UTC
Patches pushed to 3.22.x, will be in 3.22.6
Comment 16 Frédéric Demians 2016-04-27 15:41:00 UTC
Pushed to 3.20.x, will be in 3.20.11.