https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6892
--- Comment #21 from Jan Kissig <[email protected]> --- Created attachment 204256 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204256&action=edit Bug 6892: Fix links on MARCdetail.tt when protocol is missing This patch will check for URLs in MARC21 data by following the approach from details xsl template AddMissingProtocol: - when a protocol prefix is given (URI starts with "^[A-Za-z]:") the URL then gets wrapped in an html <a> element - when no protocol prefix is given it gets added based on indicator 1 of that subfield: - ind1=0 prefixed with mailto: - ind1=1 prefixed with ftp:// - ind1=2 prefixed with telnet:// - ind1=3 prefixed with tel: - ind1=4 prefixed with http:// - ind1=7 ommitted When prefix is added, the URL then gets wrapped in an html <a> element This will apply to all subfields flagged as 'is url' in MARC framework. This also fixes a small bug: the subfield code (f.e. 'u') was displayed even when sys pref hide_marc is set to Don't show Test plan: a) import demo record from listed attachments via More -> Cataloging -> Stage MARC records for import This record 1. 856 4 _u example.com 2. 856 4 _u https://example.com 3. 856 _u https://example.com 4. 856 _u example.com 5. 856 0 _u mailto:[email protected] 6. 856 0 _u [email protected] 7. 856 _u mailto:[email protected] 8. 856 _u [email protected] 9. 856 2 _u locis.loc.gov 10. 856 2 _u telnet://locis.loc.gov 11. 856 _u telnet://locis.loc.gov 12. 856 _u locis.loc.gov 13. 856 1 _u ftp.gnu.org/gnu/ 14. 856 1 _u ftp://ftp.gnu.org/gnu/ 15. 856 _u ftp://ftp.gnu.org/gnu/ 16. 856 _u ftp.gnu.org/gnu/ 17. 856 3 _u 123456789 18. 856 3 _u tel:123456789 19. 856 _u tel:123456789 20. 856 _u 123456789 21. 505 4 _u http://ftp.gnu.org/gnu/ b) open the records MARC view (MARCdetail.pl) and take a look at the links in tab 5 and 8 - check all URLs are links. - check that all URLs missing a protocol prefix (http:, ftp:, mailto:, etc) link to the ktd instance like http://KTDINSTANCE/cgi-bin/koha/catalogue/wrong_url_here - check all URLs having a protocol prefix as they will link correctly. c) apply patch and reload MARCdetail.pl (maybe a restart_all is required) - check that URLS without a protol prefix get a prefix added when an apporiate indicator is given (f.e. 1, 6, 9, 13, 17) - check that only URLs with a protocol prefix are now linked. d) when syspref hide_marc=Don't show only URLs with protocol get linked. e) with syspref LabelMARCView=Do only URLs with protocol get linked. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
