Works great when admin adds new users....but no bio shows up when new users register themselves
bflora - August 21, 2008 - 22:14
| Project: | Bio |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi there,
When my administrator account creates a new users, everything works great with bio. A new user is created with a new biography. I have bio set to takeover the profile and it's doing great.
But when a new user comes to the site and registers....no biography is created for that user. They have to go in and make it themselves.
What's the hold up? How do I fix this? thanks.

#1
I just sank 4 hours into testing this.....
1. I've got two biography fields exposed to the registration form. Both required.
2. When a user fills them in and submits the form....they're taken ot their profile page instead of the bio.
3. The bio hasn't been created. The settings they put on the registration form were not saved.
My Theory: The settings form the submissions form aren't being saved for some reason...and so Bio doesn't know to create a biography module for the new user.
What could cause the settings from the registration form to not be saved? That might be the root of the problem.
#2
I think I'm sorted out. I was using LoginTobbagan to let users login immediately upon signing up...and so the bio node wasn't being created when they first showed up on the site. Ok.
#3
Automatically closed -- issue fixed for two weeks with no activity.
#4
The issue here is that node.module in core sets the $form['uid'] to be a value on the back-end if a new node is being created, and this is synced with the global $user. So the admin ends up creating more bios for him/herself.
Adding a single line to bio_form_alter will fix this:
<?phpif (isset($form['author']['name'])) {
$form['author']['name']['#default_value'] = $account->name;
$form['author']['name']['#value'] = $account->name;
$form['author']['name']['#disabled'] = TRUE;
$form['uid']['#value'] = $account->uid; // ADDED THIS: SET THE UID ALSO OR ELSE IT WILL FAIL VALIDATION
unset($form['author']['name']['#autocomplete_path']);
$form['author']['name']['#description'] = t('This field is disabled. You cannot alter the author of this entry from within the user area.');
}
?>
Hopefully this will get added. Otherwise, it's not hard to do via a different form_alter.
#5
Seems reasonable. Committed! Thanks!
#6
You're on a roll!
#7
Automatically closed -- issue fixed for 2 weeks with no activity.