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 <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-10-03 09:51:31 +02:00 committed by Katrin Fischer
parent 1b923e946a
commit 7bcce097f7
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 6 additions and 6 deletions

View File

@ -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' );

View File

@ -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 %]
<a href="#[% table_id | uri %]">[% tablename | html %]</a>
[% UNLESS loop.last %]<span class="separator"> | </span>[% 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 %]
<div class="datatable_config" id="[% table_id | html %]">
<input type="hidden" name="table_id" value="[% table_id| html %]" />
[% IF pagename == 'additem' AND tablename == 'itemst' %]
@ -57,7 +57,7 @@
</thead>
<tbody>
[% FOR column IN tables.$pagename.$tablename.columns %]
[% SET value = pagename _ '#' _ tablename _ '#' _ column.columnname %]
[% SET value = pagename _ '|' _ tablename _ '|' _ column.columnname %]
<tr>
<td>
[% column.columnname | html %]
@ -137,7 +137,7 @@
[% IF table_settings.default_sort_order.defined %]
<p>
Default sort order:
<select name="[% pagename | html %]#[% tablename | html %]_default_sort_order">
<select name="[% pagename | html %]|[% tablename | html %]_default_sort_order">
[% FOR column IN tables.$pagename.$tablename.columns %]
[% IF table_settings.default_sort_order == loop.count - 1 %]
<option value="[% loop.count - 1 %]" selected="selected">[% column.columnname | html %]</option>