Closed (duplicate)
Project:
Registration role
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2009 at 05:57 UTC
Updated:
14 Mar 2009 at 15:08 UTC
I installed Registration Role (RR) and it was working fine. I then installed LT, and although RR initially assigns the correct role upon registration, when LT processes the confirmation email it drops the assigned role. Here is the code from Registration Role that I assume assigns the role:
/**
* Implementation of hook_user().
*
* Catch every registration and insert role
*/
function registration_role_user ($op, &$edit, &$user, $category=null)
{
if ($op == "insert" && $rid = variable_get('registration_role_roles', ''))
{
// below does not seem safe! or necessary for insert. Commented out
// clear first
// db_query( 'DELETE FROM {users_roles} WHERE uid = %d', $user->uid );
db_query('INSERT INTO {users_roles} (uid, rid) VALUES (%d, %d)', $user->uid, $rid);
}
}
I have cross posted on the RR project, as I am not sure which maintainer should handle this. Any help would be greatly appreciated. Thanks!
Comments
Comment #1
hunmonk commentedfrom
logintoboggan_user_register_submit():$roles = isset($form_values['roles']) ? array_filter($form_values['roles']) : array();registration role should not be operating on the database directly, but rather on the form data. it's the job of
user_save()to manage the saving of roles to the database.Comment #2
tbartels commentedI have a fix for this posted here: http://drupal.org/node/362067#comment-1353712
Comment #3
mlncn commentedI fixed this in the D5 branch six months ago but never created a release. I am a baaaaaaaad maintainer.
Duplicate of http://drupal.org/node/362067