Bug 38595: Fix broken table settings behaviour on some tables at the OPAC

Problem highlighted by bug 38436. There is a JS error on some views
with tables at the OPAC.

  Uncaught TypeError: table_settings.columns is undefined

Test plan:
Go to the 3 views modified by this patch and confirm that the JS error
in the console is gone when this patch is applied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-12-02 11:48:42 +01:00 committed by Katrin Fischer
parent 827126e316
commit 4733ca89a6
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
3 changed files with 3 additions and 6 deletions

View File

@ -185,7 +185,6 @@
$('#sort').change(function() {
$('#sortform').submit();
});
var columns_settings = []; // Empty because there are no columns we want to be configurable
var table = KohaTable("#table_holdshistory", {
"dom": '<"top"<"table_entries"i><"table_controls"fB>>t',
"autoWidth": false,
@ -197,7 +196,7 @@
"search": "_INPUT_",
"searchPlaceholder": _("Search")
}
}, columns_settings);
});
});
</script>
[% END %]

View File

@ -234,7 +234,6 @@
$('#sortform').submit();
});
var columns_settings = []; // Empty because there are no columns we want to be configurable
var table = KohaTable("#readingrec", {
"dom": '<"top"<"table_entries"i><"table_controls"fB>>t',
"language": {
@ -249,7 +248,7 @@
{ "visible": false, "targets": [0]},
{ "orderable": false, "targets": [1]}
],
}, columns_settings);
});
let table_dt = table.DataTable();
$("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) {

View File

@ -294,7 +294,6 @@
$(document).ready(function() {
// We show table ordered by descending dates by default
// (so that the more recent query is shown first)
var columns_settings = []; // Empty because there are no columns we want to be configurable
var table = KohaTable(".historyt", {
"order": [[ 1, "desc" ]],
"dom": '<"top"<"table_entries"><"table_controls"fB>>t',
@ -309,7 +308,7 @@
"responsive": {
"details": { "type": 'column',"target": -1 }
},
}, columns_settings);
});
$('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) {
table.DataTable().responsive.recalc();