Bug 22239 - JavaScript error on subscription detail page when there are no orders
Summary: JavaScript error on subscription detail page when there are no orders
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
: 22072 (view as bug list)
Depends on: 21467
Blocks:
  Show dependency treegraph
 
Reported: 2019-01-30 19:24 UTC by Owen Leonard
Modified: 2020-01-06 20:15 UTC (History)
6 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 22239: JavaScript error on subscription detail page when there are no orders (1.71 KB, patch)
2019-01-30 20:04 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22239: JavaScript error on subscription detail page when there are no orders (1.77 KB, patch)
2019-02-15 19:58 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 22239: JavaScript error on subscription detail page when there are no orders (1.83 KB, patch)
2019-02-15 21:51 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2019-01-30 19:24:43 UTC
I get a JavaScript error in the console when I view the details of a subscription (serials/subscription-detail.pl):

TypeError: this.data(...) is undefined[Learn More] jquery.treetable_18.1200010.js:481:7

I assume this is because I don't have any orders associated with my subscription?
Comment 1 Owen Leonard 2019-01-30 20:04:55 UTC
Created attachment 84540 [details] [review]
Bug 22239: JavaScript error on subscription detail page when there are no orders

This page modifies the subscription detail page so that a JavaScript
error isn't triggered when a subscription has no acquisition details.

To test, apply the patch and go to Serials.

 - Locate a subscription which isn't tied to acquisitions. In the
   browser console there should be no errors.
 - Locate a subscription which is part of an order. There should be an
   'Acquisitions details' tab and the order information on that tab
   should be displayed as a collapsible tree.
Comment 2 Katrin Fischer 2019-02-10 11:25:10 UTC
*** Bug 22072 has been marked as a duplicate of this bug. ***
Comment 3 Charles Farmer 2019-02-15 19:58:09 UTC
Created attachment 85190 [details] [review]
Bug 22239: JavaScript error on subscription detail page when there are no orders

This page modifies the subscription detail page so that a JavaScript
error isn't triggered when a subscription has no acquisition details.

To test, apply the patch and go to Serials.

 - Locate a subscription which isn't tied to acquisitions. In the
   browser console there should be no errors.
 - Locate a subscription which is part of an order. There should be an
   'Acquisitions details' tab and the order information on that tab
   should be displayed as a collapsible tree.

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 4 Katrin Fischer 2019-02-15 21:51:50 UTC
Created attachment 85204 [details] [review]
Bug 22239: JavaScript error on subscription detail page when there are no orders

This page modifies the subscription detail page so that a JavaScript
error isn't triggered when a subscription has no acquisition details.

To test, apply the patch and go to Serials.

 - Locate a subscription which isn't tied to acquisitions. In the
   browser console there should be no errors.
 - Locate a subscription which is part of an order. There should be an
   'Acquisitions details' tab and the order information on that tab
   should be displayed as a collapsible tree.

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Nick Clemens 2019-02-19 14:03:30 UTC
Awesome work all!

Pushed to master for 19.05
Comment 6 Martin Renvoize 2019-02-25 18:34:50 UTC
Pushed to 18.11.x for 18.11.04
Comment 7 Lucas Gass 2019-03-06 16:50:15 UTC
missing dependency for 18.05.x, won't backport