diff --git a/lib/WebGUI/Operation/Account.pm b/lib/WebGUI/Operation/Account.pm index da5ed8f0c..403cb4c6a 100644 --- a/lib/WebGUI/Operation/Account.pm +++ b/lib/WebGUI/Operation/Account.pm @@ -87,7 +87,10 @@ sub _logLogin { sub _validateProfileData { my (%data, $error, $a, %field); tie %field, 'Tie::CPHash'; - $a = WebGUI::SQL->read("select dataType,fieldName,fieldLabel,required from userProfileField"); + $a = WebGUI::SQL->read("select * from userProfileField,userProfileCategory + where userProfileField.profileCategoryId=userProfileCategory.profileCategoryId + and userProfileCategory.editable=1 and userProfileField.editable=1 + order by userProfileCategory.sequenceNumber,userProfileField.sequenceNumber"); while (%field = $a->hash) { $data{$field{fieldName}} = WebGUI::FormProcessor::process($field{fieldName},$field{dataType}); if ($field{required} && $data{$field{fieldName}} eq "") { diff --git a/lib/WebGUI/Operation/User.pm b/lib/WebGUI/Operation/User.pm index 1e0963fac..ce269a53a 100644 --- a/lib/WebGUI/Operation/User.pm +++ b/lib/WebGUI/Operation/User.pm @@ -410,7 +410,7 @@ sub www_editUserProfile { $values = eval $data{dataValues}; $method = $data{dataType}; $label = eval $data{fieldLabel}; - if ($method eq "select") { + if ($method eq "selectList" || $method eq "checkList" || $method eq "radioList") { # note: this big if statement doesn't look elegant, but doing regular # ORs caused problems with the array reference. if ($session{form}{$data{fieldName}}) { @@ -420,7 +420,12 @@ sub www_editUserProfile { } else { $default = eval $data{dataDefault}; } - $f->select($data{fieldName},$values,$label,$default); + $f->$method( + -name=>$data{fieldName}, + -options=>$values, + -label=>$label, + -value=>$default + ); } elsif ($method) { if ($session{form}{$data{fieldName}}) { $default = $session{form}{$data{fieldName}}; @@ -429,7 +434,11 @@ sub www_editUserProfile { } else { $default = eval $data{dataDefault}; } - $f->$method($data{fieldName},$label,$default); + $f->$method( + -name=>$data{fieldName}, + -label=>$label, + -value=>$default + ); } $previousCategory = $category; }