Bug 27165

Summary: Online Resource link displays as HTML in OPAC MARC view
Product: Koha Reporter: John Yorio <jyorio>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description John Yorio 2020-12-07 19:41:06 UTC
Happens in both 20.05 and 19.11:
 
In the OPAC, when using MARC view for a record with an online resource link, the complete HTML for the link is displayed for the URI.

That is, if the URI is: http://some.valid.link, the MARC preview shows:

<a href="http://some.valid.link">http://some.valid.link</a>
Comment 1 Katrin Fischer 2020-12-09 23:24:59 UTC
How was the link catalogued in this case?
Comment 2 Owen Leonard 2020-12-10 14:58:13 UTC
I can confirm this in master too. Testing with a record that has 856u populated with a regular link, the MARC view shows HTML. An example from our catalog, currently at v19.11.08:

https://search.myacpl.org/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=239528
Comment 3 Owen Leonard 2020-12-10 15:08:22 UTC
opac-MARCdetail.pl checks whether a subfield should be a link, and outputs HTML if it is. The template assumes that the subfield value *doesn't* contain HTML and uses the "html" filter on the variable. 

The template needs a check on whether the subfield is a link in order to selectively use the "$raw" filter.