Bug 25274 - JavaScript error in OPAC cart when more details are shown
Summary: JavaScript error in OPAC cart when more details are shown
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 7547
Blocks: 25271
  Show dependency treegraph
 
Reported: 2020-04-24 11:47 UTC by Owen Leonard
Modified: 2020-11-30 21:47 UTC (History)
12 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:
20.05.00, 19.11.06, 19.05.11


Attachments
Bug 25274: Don't initialize DataTable if table isn't present (2.99 KB, patch)
2020-04-24 11:56 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25274: Don't initialize DataTable if table isn't present (3.05 KB, patch)
2020-04-24 12:11 UTC, David Roberts
Details | Diff | Splinter Review
Bug 25274: Don't initialize DataTable if table isn't present (3.11 KB, patch)
2020-04-24 13:10 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-04-24 11:47:17 UTC
The fix for Bug 7547 caused a JavaScript error in the OPAC cart when the "More details" view is selected. The part of the script which adds the print button breaks when the DataTable isn't there.
Comment 1 Owen Leonard 2020-04-24 11:56:08 UTC Comment hidden (obsolete)
Comment 2 David Roberts 2020-04-24 12:11:40 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2020-04-24 13:10:47 UTC
Created attachment 103681 [details] [review]
Bug 25274: Don't initialize DataTable if table isn't present

This patch modifies the OPAC basket JavaScript so that a check is added
for the existence of the "itemst" table. This avoids an error if the
"More details" view is selected and hte "itemst" table isn't present.

To reproduce the error, add some items to the OPAC cart and open the
cart window. Open the JavaScript console in your browser and click the
"More details" link. You'll see an error.

To test, apply the patch and perform the same test as above. The error
should not be present. Test that table sorting in the "brief" view words
correctly.

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Martin Renvoize 2020-04-27 10:18:53 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Joy Nelson 2020-05-08 20:56:49 UTC
Backported to 19.11.x for 19.11.06
Comment 6 Lucas Gass 2020-05-14 20:59:51 UTC
backported to 19.05.x for 19.05.11