Posted by jjeff on July 29, 2008 at 3:31pm
Jump to:
| Project: | Bio |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
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.
| Attachment | Size |
|---|---|
| bio_for_user_fix.patch | 663 bytes |
Comments
#1
Is this an installation that predates bio_update_5100()?
#2
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.
#3
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.