for some reason, in my installation the following line doesn't return a value even though the current logged-in user has a bio:

SELECT nid FROM {bio} WHERE uid = %d

I'm guessing this might be the result of a larger problem, however I have fixed this problem with the attached patch that changes the above line to look through the node table instead.

Files: 
CommentFileSizeAuthor
bio_for_user_fix.patch663 bytesjjeff

Comments

Is this an installation that predates bio_update_5100()?

Need help figuring out why the following snippet in my Workflow NG Login Redirect results in errors:

Condition:

$nid = bio_for_user($account->uid);
$node = node_load($nid);
if (!$node->field_bio_name || sizeof($node->field_bio_name) == 0) {
  return FALSE;
} else {
  return TRUE;
}

Error:

warning: Invalid argument supplied for foreach() in modules/node/node.module on line 521.
warning: implode() [function.implode]: Bad arguments. in modules/node/node.module on line 525.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in includes/database.mysql.inc on line 172.

Status:Needs review» Needs work

I do not think that this patch fixes the cause, because you're simply skipping the bio table after Bio failed to add a record for a user.

We have some more patches waiting to be submitted, and one of them is a complete user registration overhaul.