Saw a small issue with a preceding space in 856$u once. Obviously, it is quite simple to prevent it. The current code puts http:// in front for that space. Proposed patch trims the url and adds few trivial tests in Biblio.t.
Created attachment 60793 [details] [review] Bug 18200: Fix a potential issue with preceding space in GetMarcUrls Trims the URL in order prevent prefixing a space with http:// Normally you won't have a preceding space here, but I saw it happening one day and it does not cost much to resolve it. Bonus: Adding few simple tests in t/db_dependent/Biblio.t. Test plan: [1] Run t/db_dependent/Biblio.t [2] Add a 856$u with preceding space (MARC21) [3] Check opac-detail, Online access with OPACXSLTDetailsDisplay empty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 60808 [details] [review] Bug 18200: Fix a potential issue with preceding space in GetMarcUrls Trims the URL in order prevent prefixing a space with http:// Normally you won't have a preceding space here, but I saw it happening one day and it does not cost much to resolve it. Bonus: Adding few simple tests in t/db_dependent/Biblio.t. Test plan: [1] Run t/db_dependent/Biblio.t [2] Add a 856$u with preceding space (MARC21) [3] Check opac-detail, Online access with OPACXSLTDetailsDisplay empty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Followed test plan, works as expected Signed-off-by: Marc Véron <veron@veron.ch>
Question: The biblionumber is always added to the link, something like: http://XXXXXXXXXXX/cgi-bin/koha/tracklinks.pl?uri=http://www.yyyyyyyyyy.com&biblionumber=52 It happens with and without patch (with OPACXSLTDetailsDisplay empty). Is this behaviour expected?
(In reply to Marc Véron from comment #3) > Question: The biblionumber is always added to the link, something like: > > http://XXXXXXXXXXX/cgi-bin/koha/tracklinks.pl?uri=http://www.yyyyyyyyyy. > com&biblionumber=52 > > It happens with and without patch (with OPACXSLTDetailsDisplay empty). > > Is this behaviour expected? This behavior is triggered by pref TrackClicks. It manipulates the URL and appends a biblionumber. Thanks for testing.
Created attachment 61036 [details] [review] Bug 18200: Fix a potential issue with preceding space in GetMarcUrls Trims the URL in order prevent prefixing a space with http:// Normally you won't have a preceding space here, but I saw it happening one day and it does not cost much to resolve it. Bonus: Adding few simple tests in t/db_dependent/Biblio.t. Test plan: [1] Run t/db_dependent/Biblio.t [2] Add a 856$u with preceding space (MARC21) [3] Check opac-detail, Online access with OPACXSLTDetailsDisplay empty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Followed test plan, works as expected Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 17.05, thanks Marcel!
This won't get ported back to 16.11.x as it is an enhancement.