From 7c9ae2d83bbf6b3c8594e2a363e8eed623b1e1d7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 23 Oct 2024 15:34:09 +0200 Subject: [PATCH] Bug 38240: Do not hide columns if no items to display If you filter items using the column filters and that no item are displayed, all columns will be hidden (because no data for those columns) and it is then impossible to reset the filters show items again. Test plan: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4 All items are from CPL Select another library => No items displayed Without this patch the headers are hidden and it's impossible to modify the filters With this patch the columns that were displayed on the last draw are still there, letting you modify the filters Signed-off-by: Pedro Amorim Signed-off-by: Phil Ringnalda Signed-off-by: Katrin Fischer --- .../includes/html_helpers/tables/items/catalogue_detail.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 0f15e19a52..8ccce6c896 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -836,7 +836,9 @@ }); [% END %] - update_columns_visibility(settings); + if ( api.data().length ) { + update_columns_visibility(settings); + } if ( drawcallback ) { drawcallback(this); } }, -- 2.39.5