In the user_external_load() function in user.module, on the line
if ($user = db_fetch_object($result)) {

shouldn't this be: ?
if ($user = db_fetch_array($result)) {

every XX_user() module hook seems to expect an array as does the user_load() function which it calls.

Perhaps the issue hasn't been brought up because perhaps it's hardly used, but when trying to implement an automated logon scenario it causes problems with a couple of modules.

CommentFileSizeAuthor
#4 external_load.patch423 byteschx

Comments

pfaocle’s picture

Version: 4.7.0-rc2 » 4.7.0

Still applies to 4.7. Haven't looked into this any further, tho.

pfaocle’s picture

Title: db_query_object vs db_query_array » user_external_load should use db_fetch_array, not db_fetch_object

user_load does require an array as a parameter, so cagg could be onto something.

Not in a position to test this one, ATM.

magico’s picture

Version: 4.7.0 » x.y.z

We have function user_load($array = array())

And then at function user_external_load($authname) the following

  if ($user = db_fetch_object($result)) {
    return user_load($user);

It seems wrong.

chx’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new423 bytes

This is PHP version dependent but yes. The patch is trivial.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)