Fixed a bug where this module would crash if a user that didn't exist was specified to retrieve data from.

This commit is contained in:
JT Smith 2002-05-31 01:53:34 +00:00
parent e64e640a31
commit fadd3ac327

View file

@ -269,7 +269,9 @@ sub new {
$userId = shift || 1;
$userId = _create() if ($userId eq "new");
%user = WebGUI::SQL->quickHash("select * from users where userId='$userId'");
%profile = WebGUI::SQL->buildHash("select userProfileField.fieldName, userProfileData.fieldData from userProfileField, userProfileData where userProfileField.fieldName=userProfileData.fieldName and userProfileData.userId=$user{userId}");
%profile = WebGUI::SQL->buildHash("select userProfileField.fieldName, userProfileData.fieldData
from userProfileField, userProfileData where userProfileField.fieldName=userProfileData.fieldName and
userProfileData.userId='$user{userId}'");
bless {_userId => $userId, _user => \%user, _profile =>\%profile }, $class;
}