Bugzilla – Attachment 104605 Details for
Bug 25428
Escaped HTML shows in authority detail view when subfield is a link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25428: Correctly encode link if authority subfield is a URL
Bug-25428-Correctly-encode-link-if-authority-subfi.patch (text/plain), 3.50 KB, created by
Owen Leonard
on 2020-05-08 16:23:12 UTC
(
hide
)
Description:
Bug 25428: Correctly encode link if authority subfield is a URL
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-05-08 16:23:12 UTC
Size:
3.50 KB
patch
obsolete
>From 3e8fbad92a4c22af763209f1163871c6e3b8bb54 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 8 May 2020 16:13:40 +0000 >Subject: [PATCH] Bug 25428: Correctly encode link if authority subfield is a > URL > >This patch modifies the script and template for showing the details of >an authority record so that if the authority subfield is configured to >be a link the link is correctly output in the template. > >To test you must have an authority type configured with at least one >subfield designated as a URL: > > - Go to Administration -> Authority types > - Select "MARC structure" from the actions menu for the authority type > you want to modify. > - Select "Subfields" from the actions menu for the tag containing > the subfield you want to modify (for instance 856). > - Edit the subfield you want to display as a link (e.g. subfield u). > - In the subfield configuration form under "Advanced constraints" check > the "Is a URL" checkbox and save your changes. > > - Apply the patch and go to Authorities in the staff interface. > - Search for or create an authority record which contains URL > information in the right subfield (for instance 856$u). > - View the details for the record. Using the 856 example, the "8" tab > should contain an active link pointing to the correct URL. >--- > authorities/detail.pl | 3 ++- > koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt | 6 +++++- > 2 files changed, 7 insertions(+), 2 deletions(-) > >diff --git a/authorities/detail.pl b/authorities/detail.pl >index f9724ff4ce..ca1654461d 100755 >--- a/authorities/detail.pl >+++ b/authorities/detail.pl >@@ -120,7 +120,8 @@ sub build_tabs { > my %subfield_data; > $subfield_data{marc_lib}=$tagslib->{$field->tag()}->{$subf[$i][0]}->{lib}; > if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{isurl}) { >- $subfield_data{marc_value}="<a href=\"$subf[$i][1]\">$subf[$i][1]</a>"; >+ $subfield_data{marc_value} = $subf[$i][1]; >+ $subfield_data{is_url} = 1; > } else { > $subfield_data{marc_value}=$subf[$i][1]; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt >index 9fddd71909..618e325105 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt >@@ -79,7 +79,11 @@ > <label class="labelsubfield"> > [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield | html %]</b>[% END %] > <span title="[% subfiel.long_desc | html %]" class="desc">[% subfiel.short_desc | html %]</span></label> >- [% subfiel.marc_value | html %] >+ [% IF ( subfiel.is_url ) %] >+ <a href="[% subfiel.marc_value | url %]">[% subfiel.marc_value | html %]</a> >+ [% ELSE %] >+ [% subfiel.marc_value | html %] >+ [% END %] > [% IF ( subfiel.link ) %] > <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&marclist=[% subfiel.link | uri %]&operator==&type=intranet&value=[% subfiel.marc_value |url %]"> > <img src="[% interface | html %]/[% theme | html %]/images/filefind.png" height="15" title="Search on [% subfiel.marc_value | html %]"> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25428
:
104604
|
104605
|
104967
|
105200