Bug 22239

Summary: JavaScript error on subscription detail page when there are no orders
Product: Koha Reporter: Owen Leonard <oleonard>
Component: SerialsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: colin.campbell, dcook, fridolin.somers, lucas, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 21467    
Bug Blocks:    
Attachments: Bug 22239: JavaScript error on subscription detail page when there are no orders
Bug 22239: JavaScript error on subscription detail page when there are no orders
Bug 22239: JavaScript error on subscription detail page when there are no orders

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