From 77bd7557fa7adb196ed46fd7ae3ceea98db3a67c Mon Sep 17 00:00:00 2001 From: Nick 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 Signed-off-by: Jonathan Druart Signed-off-by: Brendan A Gallagher (cherry picked from commit 65c5fa4385a8e080cfd46a8197b4417bcd579b6a) Signed-off-by: Julian Maurice --- .../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 951029a09a..3b5c404aaa 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 @@ [% END # / IF BakerTaylorContentURL %] - [% IF ( NovelistSelectProfile ) %] + [% IF ( NovelistSelectProfile && normalized_isbn ) %] [% IF ( NovelistSelectView == 'above') %] Novelist Select: @@ -597,7 +597,7 @@
  • Comments ( [% reviews.size || 0 %] )
  • [% END %] - [% IF ( NovelistSelectProfile ) %] + [% IF ( NovelistSelectProfile && normalized_isbn ) %] [% IF ( NovelistSelectView == 'tab') %]
  • Novelist Select
  • [% END %] @@ -791,7 +791,7 @@ [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %] [% END # / IF SyndeticsEnabled %] - [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab') %] + [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && normalized_isbn ) %]
    @@ -1032,7 +1032,7 @@ [% END %] - [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' ) %] + [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && normalized_isbn ) %]

    Novelist Select

    @@ -1101,7 +1101,7 @@ [% INCLUDE 'opac-detail-sidebar.inc' %] - [% IF ( NovelistSelectProfile && NovelistSelectView == 'right') %] + [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && normalized_isbn ) %]

    Novelist Select

    @@ -1143,7 +1143,7 @@ [% END %] [% END %] - [% IF ( NovelistSelectProfile ) %] + [% IF ( NovelistSelectProfile && normalized_isbn ) %] [% 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.39.5