fixed corner case which causes the user profile to not load in cases where custom forms do not work or are broken. It now skips these and throws a warning

This commit is contained in:
Frank Dillon 2007-01-17 22:16:42 +00:00
parent af9ab661a7
commit 5d4c076290

View file

@ -299,8 +299,12 @@ sub www_editProfileField {
next if $form eq 'DynamicField';
my $cmd = join '::', 'WebGUI::Form', $form;
eval "use $cmd";
my $w = eval {"$cmd"->new($session)};
push @profileForms, $form if $w->get("profileEnabled");
my $w = eval {"$cmd"->new($session)};
unless(defined $w) {
$session->errorHandler->warn("Could not load $cmd. Please check the syntax of this module to make sure it works properly");
next;
}
push @profileForms, $form if $w->get("profileEnabled");
}
$fieldType->set("types", \@profileForms);