From 7bcce097f7cc01ac8b8a64027cf005d05d316cfc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 3 Oct 2024 09:51:31 +0200 Subject: [PATCH] Bug 38069: (bug 37955 follow-up) Fix edition of table settings The form cannot longer be saved, and no appear appear (nothing in log, nothing on the UI) This is coming from bug 37955 where we modify the table_id to fix anchors, but we didn't care of the rest of the code using this TT variable. This patch suggests to replace # and _ with | Test plan: Confirm that the form can be edited, saved, and that it is taken correctly into account. Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- admin/columns_settings.pl | 4 ++-- .../prog/en/modules/admin/columns_settings.tt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl index 3f6d070275..96d591d7bb 100755 --- a/admin/columns_settings.pl +++ b/admin/columns_settings.pl @@ -24,7 +24,7 @@ if ( $op eq 'cud-save' ) { my @columnids = $input->multi_param("columnid"); my @columns; for my $columnid (@columnids) { - next unless $columnid =~ m|^([^#]*)#([^#]*)#(.*)$|; + next unless $columnid =~ m{^([^\|]*)\|([^\|]*)\|(.*)$}; my $is_hidden = $input->param( $columnid . '_hidden' ) // 0; my $cannot_be_toggled = $input->param( $columnid . '_cannot_be_toggled' ) // 0; @@ -47,7 +47,7 @@ if ( $op eq 'cud-save' ) { my @table_ids = $input->multi_param('table_id'); for my $table_id (@table_ids) { - next unless $table_id =~ m|^([^#]*)#(.*)$|; + next unless $table_id =~ m{^([^\|]*)\|(.*)$}; my $default_display_length = $input->param( $table_id . '_default_display_length' ); my $default_sort_order = $input->param( $table_id . '_default_sort_order' ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt index 0870bd58df..28a3b2a0ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt @@ -23,14 +23,14 @@ [% IF tables.$pagename.keys and tables.$pagename.keys.size > 1 %] Jump to table: [% FOR tablename IN tables.$pagename.keys.sort %] - [% SET table_id = pagename _ '#' _ tablename %] + [% SET table_id = pagename _ '|' _ tablename %] [% tablename | html %] [% UNLESS loop.last %] | [% END %] [% END %] [% END %] [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %] [% FOR tablename IN tables.$pagename.keys.sort %] - [% SET table_id = pagename _ '_' _ tablename %] + [% SET table_id = pagename _ '|' _ tablename %]
[% IF pagename == 'additem' AND tablename == 'itemst' %] @@ -57,7 +57,7 @@ [% FOR column IN tables.$pagename.$tablename.columns %] - [% SET value = pagename _ '#' _ tablename _ '#' _ column.columnname %] + [% SET value = pagename _ '|' _ tablename _ '|' _ column.columnname %] [% column.columnname | html %] @@ -137,7 +137,7 @@ [% IF table_settings.default_sort_order.defined %]

Default sort order: - [% FOR column IN tables.$pagename.$tablename.columns %] [% IF table_settings.default_sort_order == loop.count - 1 %] -- 2.39.5