[Bug 20218] New: Tracklinks fails when URL has special characters
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Bug ID: 20218 Summary: Tracklinks fails when URL has special characters Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 1 - Copy the url of a biblio in the opac 2 - Paste this into the 856$u ofd another record 3 - Enable anonymous link tracking 4 - View the second record in the opac 5 - Click the link 6 - Get a 404 error It seems on this line: if ( grep { /^$uri$/ } map { $_->{MARCURL} } @$marc_urls ) { The regex is reading the '?' in the uri as a special character and so the uri is not matched -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19847 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |barton@bywatersolutions.com Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 71745 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71745&action=edit Bug 20218: Fix matching of uri in tracklinks The current code matches using a regex, this breaks when the url contains special characters. We swtich it to equality check To test: 1 - Enable TrackClicks (either track or anonymous) 2 - Find the URL of a biblio in the OPAC 3 - Paste this into the 856$u of another record (or use any url containing a '?' or other characters) 4 - View the record in the opac 5 - Click the URL 6 - 404 Error! 7 - Apply patch 8 - Try again 9 - Success! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Maksim Sen <maksim.sen@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maksim.sen@inlibro.com --- Comment #2 from Maksim Sen <maksim.sen@inlibro.com> --- Hey Nick, I tried applying the patch (I'm currently on the master branch), but I got this error, Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 20218: Fix matching of uri in tracklinks Using index info to reconstruct a base tree... M opac/tracklinks.pl Falling back to patching base and 3-way merge... Auto-merging opac/tracklinks.pl CONFLICT (content): Merge conflict in opac/tracklinks.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 20218: Fix matching of uri in tracklinks The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-20218-Fix-matching-of-uri-in-tracklinks-KoSJEI.patch Is there an extra step needed to apply this patch? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Applies cleanly for me on master, can you make sure you are up to date and try again? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Bumping severity - this breaks functionality for anyone using trackclicks and affects users directly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71745|0 |1 is obsolete| | --- Comment #5 from Claire Gravely <claire_gravely@hotmail.com> --- Created attachment 72215 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72215&action=edit Bug 20218: Fix matching of uri in tracklinks The current code matches using a regex, this breaks when the url contains special characters. We swtich it to equality check To test: 1 - Enable TrackClicks (either track or anonymous) 2 - Find the URL of a biblio in the OPAC 3 - Paste this into the 856$u of another record (or use any url containing a '?' or other characters) 4 - View the record in the opac 5 - Click the URL 6 - 404 Error! 7 - Apply patch 8 - Try again 9 - Success! Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #72215|0 |1 is obsolete| | --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 72246 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72246&action=edit Bug 20218: Fix matching of uri in tracklinks The current code matches using a regex, this breaks when the url contains special characters. We swtich it to equality check To test: 1 - Enable TrackClicks (either track or anonymous) 2 - Find the URL of a biblio in the OPAC 3 - Paste this into the 856$u of another record (or use any url containing a '?' or other characters) 4 - View the record in the opac 5 - Click the URL 6 - 404 Error! 7 - Apply patch 8 - Try again 9 - Success! Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to stable for 17.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20218 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #9 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x for v17.05.10 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org