Bug 27165 - Online Resource link displays as HTML in OPAC MARC view
Summary: Online Resource link displays as HTML in OPAC MARC view
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-07 19:41 UTC by John Yorio
Modified: 2023-07-01 14:37 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.