From 4cf0100ef22b593109eb8e45f5593eea6b7c6485 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 22 Nov 2010 13:52:20 +0100 Subject: [PATCH] Benutzerdefinierte Variablen: bei nicht existierenden die Defaultwerte wieder nutzen --- SL/CVar.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/CVar.pm b/SL/CVar.pm index 7f82a2d8b..8c4f6a899 100644 --- a/SL/CVar.pm +++ b/SL/CVar.pm @@ -224,7 +224,7 @@ sub get_custom_variables { $cvar->{OPTIONS} = [ map { { 'value' => $_ } } split(m/\#\#/, $cvar->{options}) ]; } - my $act_var; + my ($act_var, $valid); if ($params{trans_id}) { my @values = (conv_i($cvar->{id}), conv_i($params{trans_id})); push @values, $params{sub_module} if $params{sub_module}; @@ -232,7 +232,7 @@ sub get_custom_variables { do_statement($form, $h_var, $q_var, @values); $act_var = $h_var->fetchrow_hashref(); - $act_var->{valid} = $self->get_custom_variables_validity(config_id => $cvar->{id}, trans_id => $params{trans_id}); + $valid = $self->get_custom_variables_validity(config_id => $cvar->{id}, trans_id => $params{trans_id}); } if ($act_var) { @@ -241,7 +241,7 @@ sub get_custom_variables { : $cvar->{type} eq 'number' ? $act_var->{number_value} : $cvar->{type} eq 'bool' ? $act_var->{bool_value} : $act_var->{text_value}; - $cvar->{valid} = $act_var->{valid}; + $cvar->{valid} = $valid; } else { $cvar->{valid} = 1; -- 2.20.1