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 <pedro.amorim@ptfs-europe.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-10-23 15:34:09 +02:00 committed by Katrin Fischer
parent 91ba4fcfd7
commit 7c9ae2d83b
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 3 additions and 1 deletions

View File

@ -836,7 +836,9 @@
});
[% END %]
update_columns_visibility(settings);
if ( api.data().length ) {
update_columns_visibility(settings);
}
if ( drawcallback ) { drawcallback(this); }
},