From fb7e332e0f27a2c475807aedd47898ce92bdf093 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 22 Aug 2022 08:15:34 +0100 Subject: [PATCH] Bug 31435: Tie 'Configure' to table_settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a check for table_settings to prevent the display of 'Configure this table' when table settings are not passed to the datatable wrapper. Signed-off-by: Katrin Fischer Suggested test plan: * Without patch: * Go to Administration > SMTP servers * Verify the configure button shows, but doesn't work * Apply patch * Reload the SMTP servers page * The configure button will no longer show Signed-off-by: Joonas Kylmälä --- koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc | 2 +- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc index 332868f370..8df6eb56cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -161,7 +161,7 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { } ); - if ( CAN_user_parameters_manage_column_config ) { + if ( table_settings && CAN_user_parameters_manage_column_config ) { dt_parameters[ "buttons" ].push( { className: "dt_button_configure_table", diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index f4247ae343..f6b079c794 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -813,7 +813,7 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { } ); - if ( CAN_user_parameters_manage_column_config ) { + if ( table_settings && CAN_user_parameters_manage_column_config ) { settings[ "buttons" ].push( { className: "dt_button_configure_table", -- 2.30.2