From 968c6df00769b2cc83daa53ce642183eeee5e025 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 14 Mar 2025 09:31:57 +0000 Subject: [PATCH] Bug 37784: [24.05] (QA follow-up) Bail out to new definition The code went back to step 3 but the error message is not there. It is easier to go back to the start: no need to fetch columns. And this is now an exception; it will only come up when trying malicious things. Also turned foreach and unless forbidden around. No need to go into the loop when we found a forbidden field. Test plan: See first patch. You should see the message now. Signed-off-by: Alex Buckley (cherry picked from commit a4888ff9a9b3ef33caecfca7c93d146ae1696ff6) Signed-off-by: Fridolin Somers --- reports/dictionary.pl | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/reports/dictionary.pl b/reports/dictionary.pl index b32a95024c..082b093dc9 100755 --- a/reports/dictionary.pl +++ b/reports/dictionary.pl @@ -92,8 +92,8 @@ elsif ( $phase eq 'New Term step 4' ) { my $columnstring = join( ',', @columns ); my $forbidden = Koha::Report->new->check_columns( undef, \@columns ); my @column_loop; - foreach my $column (@columns) { - unless ($forbidden) { + unless ($forbidden) { + foreach my $column (@columns) { my %tmp_hash; $tmp_hash{'name'} = $column; my $type = get_column_type($column); @@ -123,16 +123,7 @@ elsif ( $phase eq 'New Term step 4' ) { 'columnstring' => $columnstring, ); } else { - my $columns = get_columns( $area, $input ); - $template->param( - 'step_3' => 1, - 'area' => $area, - 'definition_name' => $definition_name, - 'definition_description' => $definition_description, - 'columns' => \@column_loop, - 'columnstring' => $columnstring, - 'passworderr' => 1, - ); + $template->param( 'new_dictionary' => 1, passworderr => 1 ); } }