From c4e1140cdd0f7d2dcdf7432375f96e34b9bc32d0 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 11 Sep 2020 09:16:57 -0300 Subject: [PATCH] Bug 20212: Remove warning if no basket group If any row contains no basket group, the browser console will show a datatables warning about basket.basket_group.name not existing. This patch gets rid of it. --- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index b7586783a9..20530a5940 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -423,10 +423,17 @@ return "" + data + " (" + row.basket.basket_id + ")"; } }, - { "data": "basket.basket_group.name", + { "data": "basket.basket_group", "orderable": true, "render": function(data, type, row, meta) { - if ( type != 'display' ) return data; + if ( type != 'display' ) { + if ( data == null ) { + return ""; + } + else { + return data.name; + } + } if ( row.basket.basket_group_id == null ) { return _("No basket group"); } -- 2.28.0