bugfix: default value only worked for select list fields

This commit is contained in:
Len Kranendonk 2004-07-26 09:45:34 +00:00
parent 1ba29d7d85
commit bc2e8b649e
3 changed files with 6 additions and 2 deletions

View file

@ -16,6 +16,7 @@
statistics. (Thanks to DonorWare for funding this feature.)
- Fixed a typo in Forum/UI.pm
- bugfix [ 996284 ] Compile error in macro.pm
- bugfix [ 997918 ] Default value in profile not working
6.1.1
- bugfix [ 991313 ] Manage Translations doesn't work

View file

@ -65,7 +65,10 @@ sub getRequiredProfileFields {
$default = $session{form}{$data->{fieldName}};
} elsif (exists $session{user}{$data->{fieldName}}) {
$default = $session{user}{$data->{fieldName}};
}
} else {
$default = $data->{dataDefault};
}
my $cmd = 'WebGUI::Form::'.$method.'({"name"=>$data->{fieldName},"value"=>$default})';
$hash{'profile.formElement'} = eval($cmd);

View file

@ -228,7 +228,7 @@ sub www_editProfileFieldSave {
$session{form}{fieldLabel} = 'Unamed' if ($session{form}{fieldLabel} eq "" || $session{form}{fieldLabel} eq "''");
$test = eval($session{form}{fieldLabel});
$session{form}{fieldLabel} = "'".$session{form}{fieldLabel}."'" if ($test eq "");
if ($session{form}{dataDefault} ne "") {
if ($session{form}{dataDefault} && $session{form}{dataType}=~/List$/) {
unless ($session{form}{dataDefault} =~ /^\[/) {
$session{form}{dataDefault} = "[".$session{form}{dataDefault};
}