Bug 15210 - Novelist js throws an error if no ISBN
Summary: Novelist js throws an error if no ISBN
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-18 16:48 UTC by Nick Clemens (kidclamp)
Modified: 2017-06-14 22:05 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15210 - Novelist throws an error if no ISBN (4.19 KB, patch)
2015-11-18 16:59 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 15210 - Novelist throws an error if no ISBN (4.25 KB, patch)
2015-12-17 22:40 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 15210 - Novelist throws an error if no ISBN (4.32 KB, patch)
2015-12-18 09:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15210 - Novelist throws an error if no ISBN (4.38 KB, patch)
2015-12-30 03:56 UTC, Brendan Gallagher
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2015-11-18 16:48:51 UTC
If novelist is enabled and a record has no ISBN the js throws an error which subsequently breaks any custom code from opacuserjs.
Comment 1 Nick Clemens (kidclamp) 2015-11-18 16:59:25 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2015-12-17 22:40:38 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-12-18 09:55:03 UTC Comment hidden (obsolete)
Comment 4 Brendan Gallagher 2015-12-30 03:56:15 UTC
Created attachment 46064 [details] [review]
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>
Comment 5 Brendan Gallagher 2015-12-30 03:56:48 UTC
pushed to master - thanks!
Comment 6 Julian Maurice 2015-12-31 09:15:29 UTC
Patch pushed to 3.22.x, will be in 3.22.2
Comment 7 Frédéric Demians 2015-12-31 18:28:38 UTC
This patch has been pushed to 3.20.x, will be in 3.20.8.