With HEAD version downloaded March 3, 2007
// $Id: ldapdata.module,v 1.11 2007/03/03 03:23:56 scafmac Exp $
LDAP user login fails with whitescreen and this error:
Fatal error: Cannot use object of type stdClass as array in
/srv/www/drupal-5.1/modules/ldap_integration/ldapdata.module on line 529
Comments
Comment #1
rar commentedAlso occurs when trying to edit a user: ( http://localhost/user/2/edit )
Comment #2
rar commentedModify lines 527-529
from:
> $result = db_fetch_array(db_query("SELECT fid FROM {profile_fields} WHERE name = '%s'", $field));
> $fid = $result['fid'];
> $uid = $user['uid'];
to:
< $result = db_fetch_array(db_query("SELECT fid,uid FROM {profile_fields} WHERE name = '%s'", $field));
< $fid = $result['fid'];
< $uid = $result['uid'];
Comment #3
rar commentedComment #4
rar commentedOops - too quick on the submit button - should be
Modify line 529 only
from:
$uid = $user['uid'];to:
$uid = $user->uid;Comment #5
scafmac commentedThanks - will commit the patch to head shortly.
Comment #6
scafmac commentedRar,
I'm unable to duplicate the problem, though it is clearly a problem. Will you test something for me? Return the select statement to the original syntax (including uid) and then change $user->uid to $result['uid'] on line 529. Does that work?
Thanks
Comment #7
scafmac commentedI don't believe you should be using the global user variable for the source of the uid. The uid should come from the profile table. So as you noted originally, the select statement and the $user assignment statement need to be fixed.
I've changed it and am testing it. I'll commit it to head shortly.
Comment #8
rar commentedBut 'uid' doesn't exist in the table profile_fields. I.e.
Comment #9
scafmac commentedThat'll teach me to stop multitasking at work - You're absolutely correct; I was looking at profile_values instead and didn't see that $user was passed in.
Anyhow thanks for the catch. It is fixed in HEAD.