From a27a6e6d729cd3b6be0251c1c6bda5a763fea6bc 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 Signed-off-by: Nick Clemens --- .../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.39.5