Conflict with Registration Role

affinitymc - January 15, 2009 - 05:57
Project:Registration role
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:duplicate
Description

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!

#1

hunmonk - March 6, 2009 - 03:36
Project:LoginToboggan» Registration role
Version:5.x-1.3» 5.x-1.x-dev

from logintoboggan_user_register_submit():

<?php
$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.

#2

tbartels - March 14, 2009 - 08:00

I have a fix for this posted here: http://drupal.org/node/362067#comment-1353712

#3

Benjamin Melançon - March 14, 2009 - 15:08
Status:active» duplicate

I 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

 
 

Drupal is a registered trademark of Dries Buytaert.