Bugzilla – Attachment 95661 Details for
Bug 23482
BakerTaylor images broken on OPAC lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23482: Fix BakerTaylor cover images on lists
Bug-23482-Fix-BakerTaylor-cover-images-on-lists.patch (text/plain), 4.50 KB, created by
ByWater Sandboxes
on 2019-11-21 14:53:22 UTC
(
hide
)
Description:
Bug 23482: Fix BakerTaylor cover images on lists
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2019-11-21 14:53:22 UTC
Size:
4.50 KB
patch
obsolete
>From 2bcebc82da5de7e9970b94bd9e75b3fe1b0ccb96 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 21 Aug 2019 02:24:11 +0000 >Subject: [PATCH] Bug 23482: Fix BakerTaylor cover images on lists > >While this needs a username/pass to fully test, it should be possible to >verify the code changes by comparing to opac-results code > >To test: >1 - Enable BakerTaylor images >2 - Enter your usernme and password >3 - Do not fill the BookStore URL >4 - Verify OPAC covers are working >5 - Save some times with covers to a public list >6 - Verify they do not display in list >7 - Apply patch >8 - Verify images now work > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 15 +++++++++++++-- > opac/opac-shelves.pl | 14 ++++++++++++++ > 2 files changed, 27 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index c1d273f66e..cc5f75c5b1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -352,10 +352,21 @@ > [% END %] > > </a> <!-- / .p1 --> >- [% IF ( BakerTaylorEnabled ) %] >+ [% IF ( Koha.Preference('BakerTaylorEnabled') && !Koha.Preference('BakerTaylorBookstoreURL') ) %] > [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %] > [% IF ( bt_id ) %] >- <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a> >+ <img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /> >+ [% ELSE %] >+ <span class="no-image">No cover image available</span> >+ [% END %] >+ [% END %] >+ >+ [% IF ( Koha.Preference('BakerTaylorEnabled') && Koha.Preference('BakerTaylorBookstoreURL') ) %] >+ [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %] >+ [% IF ( bt_id ) %] >+ <a href="https://[% Koha.Preference('BakerTaylorBookstoreURL') | uri %][% bt_id | uri %]"> >+ <img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /> >+ </a> > [% ELSE %] > <span class="no-image">No cover image available</span> > [% END %] >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 802366d994..f51044b626 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -40,6 +40,13 @@ use Koha::RecordProcessor; > > use constant ANYONE => 2; > >+BEGIN { >+ if (C4::Context->preference('BakerTaylorEnabled')) { >+ require C4::External::BakerTaylor; >+ import C4::External::BakerTaylor qw(&image_url &link_url); >+ } >+} >+ > my $query = new CGI; > > my $template_name = $query->param('rss') ? "opac-shelves-rss.tt" : "opac-shelves.tt"; >@@ -57,6 +64,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ > authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), > }); > >+if (C4::Context->preference("BakerTaylorEnabled")) { >+ $template->param( >+ BakerTaylorImageURL => &image_url(), >+ BakerTaylorLinkURL => &link_url(), >+ ); >+} >+ > my $op = $query->param('op') || 'list'; > my $referer = $query->param('referer') || $op; > my $category = $query->param('category') || 1; >-- >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 23482
:
92390
|
95661
|
99247
|
99248
|
99372
|
99374
|
99383
|
100686