From 5d4c07629026e2c90c2dece5d835233070799161 Mon Sep 17 00:00:00 2001 From: Frank Dillon Date: Wed, 17 Jan 2007 22:16:42 +0000 Subject: [PATCH] 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 --- lib/WebGUI/Operation/ProfileSettings.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Operation/ProfileSettings.pm b/lib/WebGUI/Operation/ProfileSettings.pm index 579d17c15..6cff25658 100644 --- a/lib/WebGUI/Operation/ProfileSettings.pm +++ b/lib/WebGUI/Operation/ProfileSettings.pm @@ -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);