From d95d882b2dd5dbe44e7ae57082251b2af87549fb Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 30 Jan 2019 19:58:25 +0000 Subject: [PATCH] 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 Signed-off-by: Katrin Fischer --- .../prog/en/modules/serials/subscription-detail.tt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index 193b70758a..7a2567ddbe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -505,10 +505,12 @@ 'bSort': false, }, columns_settings); - $(table).treetable({ - expandable: true - }); - $(table).treetable('expandAll'); + [% IF orders_grouped.size %] + $(table).treetable({ + expandable: true + }); + $(table).treetable('expandAll'); + [% END %] $("#hide_received_orders").click(function(e){ e.preventDefault(); -- 2.11.0