Bug 16031

Summary: sitemap.pl shouldn't append protocol to OPACBaseURL
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Command-line UtilitiesAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: brendan, f.demians, julian.maurice, mtompset, robin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 5010, 11190    
Bug Blocks:    
Attachments: Bug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL
Bug 16031: (followup) Fix documentation
[SIGNED-OFF] Bug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL
[SIGNED-OFF] Bug 16031: (followup) Fix documentation
Bug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL
Bug 16031: (followup) Fix documentation

Description Tomás Cohen Arazi 2016-03-09 18:39:43 UTC
Right now, the script appends a fixed protocol (HTTP) to the generated URL. This is because the tool was written before bug 5010 was pushed.

To reproduce:
- Have OPACBaseURL set
- Run the script (without the --url parameter)
=> FAIL: Notice the generated sitemap files contain double protocol specification on the URLs (like in http://http:// or http://https://)
Comment 1 Tomás Cohen Arazi 2016-03-09 18:48:15 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2016-03-09 18:48:20 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2016-03-09 20:08:13 UTC Comment hidden (obsolete)
Comment 4 Mark Tompsett 2016-03-09 20:08:58 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-03-10 12:32:28 UTC
Created attachment 48952 [details] [review]
Bug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL

Since bug 5010 was pushed, OPACBaseURL already contains the protocol. The
sitemap.pl script was written before this was pushed, and thus still concatenates
http:// in front of OPACBaseURL.

This patch removes this behaviour.

To test:
- Have OPACBaseURL set to (say) http://myopac.com
- Run the sitemap.pl script without specifying the --url param
=> FAIL: Notice URLs look like http://http://myopac.com/bib... in the sitemap files.
- Apply the patch
- Run the sitemap.pl script without specifying the --url param
=> SUCCESS: Notice URLs look correctly like http://myopac.com/bib...
- Sign off :-D

Regards

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2016-03-10 12:32:33 UTC
Created attachment 48953 [details] [review]
Bug 16031: (followup) Fix documentation

This followup fixes a tiny mistake in the script POD.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Brendan Gallagher 2016-03-11 15:29:51 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks
Comment 8 Julian Maurice 2016-03-14 09:30:54 UTC
Patches pushed to 3.22.x, will be in 3.22.5