Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: 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 CreditAttribution: tbartels commentedI have a fix for this posted here: http://drupal.org/node/362067#comment-1353712
Comment #3
mlncn CreditAttribution: 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