From fadd3ac3278fa0d34f0a7c43870fa2531b02174c Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 31 May 2002 01:53:34 +0000 Subject: [PATCH] Fixed a bug where this module would crash if a user that didn't exist was specified to retrieve data from. --- lib/WebGUI/User.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/User.pm b/lib/WebGUI/User.pm index f5f12fed3..1100c4f00 100644 --- a/lib/WebGUI/User.pm +++ b/lib/WebGUI/User.pm @@ -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; }