Bugzilla – Attachment 46064 Details for
Bug 15210
Novelist js throws an error if no ISBN
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15210 - Novelist throws an error if no ISBN
-Bug-15210---Novelist-throws-an-error-if-no-ISBN.patch (text/plain), 4.38 KB, created by
Brendan Gallagher
on 2015-12-30 03:56:15 UTC
(
hide
)
Description:
Bug 15210 - Novelist throws an error if no ISBN
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2015-12-30 03:56:15 UTC
Size:
4.38 KB
patch
obsolete
>From 65c5fa4385a8e080cfd46a8197b4417bcd579b6a Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Wed, 18 Nov 2015 11:49:15 -0500 >Subject: [PATCH] Bug 15210 - Novelist throws an error if no ISBN > >This patch makes opac-detail.tt check for an ISBN before attempting to load Novelist content and prevents a js error which breaks other code. > >To test: >1 - Enable novelist >2 - Add a visible change to OPACUserJS eg: $(document).ready(function() {$("body").css("background-color","pink");}); >3 - Load a record with no ISBN >4 - Note you do not see a color change in the body and that there is an error in the console >5 - Apply patch >6 - Reload the record >7 - You should see the color change and no error in the js > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 951029a..3b5c404 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -523,7 +523,7 @@ > </span> > [% END # / IF BakerTaylorContentURL %] > >- [% IF ( NovelistSelectProfile ) %] >+ [% IF ( NovelistSelectProfile && normalized_isbn ) %] > [% IF ( NovelistSelectView == 'above') %] > <span class="results_summary"> > <span class="label">Novelist Select: </span> >@@ -597,7 +597,7 @@ > <li id="tab_comments"><a href="#comments">Comments ( [% reviews.size || 0 %] )</a></li> > [% END %] > >- [% IF ( NovelistSelectProfile ) %] >+ [% IF ( NovelistSelectProfile && normalized_isbn ) %] > [% IF ( NovelistSelectView == 'tab') %] > <li id="tab_NovelistSelect"> <a href="#NovelistSelect">Novelist Select</a></li> > [% END %] >@@ -791,7 +791,7 @@ > [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %] > [% END # / IF SyndeticsEnabled %] > >- [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab') %] >+ [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && normalized_isbn ) %] > <div id="NovelistSelect"> > <div data-novelist-novelistselect=[% normalized_isbn %]></div> > </div> >@@ -1032,7 +1032,7 @@ > [% END %] > </div> <!-- / #bibliodescriptions --> > >- [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' ) %] >+ [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && normalized_isbn ) %] > <div id="NovelistSelect"> > <h3>Novelist Select</h3> > <div data-novelist-novelistselect="[% normalized_isbn %]"></div> >@@ -1101,7 +1101,7 @@ > > [% INCLUDE 'opac-detail-sidebar.inc' %] > >- [% IF ( NovelistSelectProfile && NovelistSelectView == 'right') %] >+ [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && normalized_isbn ) %] > <div id="NovelistSelect"> > <h4>Novelist Select</h4> > <div data-novelist-novelistselect=[% normalized_isbn %]></div> >@@ -1143,7 +1143,7 @@ > [% END %] > [% END %] > >- [% IF ( NovelistSelectProfile ) %] >+ [% IF ( NovelistSelectProfile && normalized_isbn ) %] > <script type="text/javascript" src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script> > [% END %] > >@@ -1474,7 +1474,7 @@ > [% IF OPACLocalCoverImages %] > KOHA.LocalCover.GetCoverFromBibnumber(true); > [% END %] >- [% IF ( NovelistSelectProfile ) %] >+ [% IF ( NovelistSelectProfile && normalized_isbn ) %] > novSelect.loadContentForISBN('[% normalized_isbn %]','[% NovelistSelectProfile %]', '[% NovelistSelectPassword %]', function(d){}); > [% END %] > >-- >2.1.4
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 15210
:
44965
|
45787
|
45802
| 46064