I am using an implementation of drupal in php5. When I request a new password, I do not get any messages after completing the request. I am sent back to log-in tab. I traced the error to the user_load function where $user is returned initialized to StdClass, and then passing the condition if($account) in the function user_pass thus never showing the message.

CommentFileSizeAuthor
#3 user_load.patch2.88 KBkilles@www.drop.org

Comments

Diego Camacho’s picture

This error only happens when you enter and invalid account name

trebuchet’s picture

Diego, is the problem you're experiencing related to this one? I think it might be the result of differences in the way php 4 and 5 handle objects.

killes@www.drop.org’s picture

Version: 4.6.3 » x.y.z
Priority: Critical » Normal
Status: Active » Needs review
StatusFileSize
new2.88 KB

user_load indeed needs to be changed to return FALSE in case of failure. Attached is a patch. I reviewed all core modules and I am fairly certain that nothign breaks. But I didn't do a real test. I do not know if contrib modules will break due to this change.

I guess it should be fixed for 4.6 too.

killes@www.drop.org’s picture

Status: Needs review » Fixed

user_load has been changed to return FALSE.

Anonymous’s picture

Status: Fixed » Closed (fixed)