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>
(cherry picked from commit 65c5fa4385)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
parent
3073d25f03
commit
77bd7557fa
|
|
@ -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 %]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue