CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Using Rules Action to Create User Problem with Duplicate First and Last Names
Pages: [1]

Author Topic: Using Rules Action to Create User Problem with Duplicate First and Last Names  (Read 1246 times)

jackrabbithanna

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 3
  • Quick like bunny
    • http://www.skvare.com
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: 5.1
  • PHP version: 5.3.3
Using Rules Action to Create User Problem with Duplicate First and Last Names
April 19, 2013, 07:20:55 am
I'm using rules to create a user when a user becomes a member, instead of using the built in feature of when a user fills out a profile. There is an action available to Rules called "Create Linked Drupal User Account".  This feature works good for new contacts.  I have a contribution page, where users can enter their first and last name among other fields, and they can pay for membership. 
If I enter the name John Smith and use a email address it all works fine.  A user is created with the username being a combination of the first and last names ("First Last")
 Lets say another user(different person) has the same exact first and last name.  Even though they are different people and enter different email addresses the second time around I get an error saying "cannot create user account"  Why is that?? Thats no good.

I'm assuming the rules action is trying to create a user with the same user name because of the same first and last names.  Is there no config to choose what data is used to create the user name?

Testing this in 4.3....

jackrabbithanna

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 3
  • Quick like bunny
    • http://www.skvare.com
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Using Rules Action to Create User Problem with Duplicate First and Last Names
April 19, 2013, 12:55:08 pm
Where is the code for this Rules action?  I can't seem to find it in the files for the Rules Integration module....

jackrabbithanna

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 3
  • Quick like bunny
    • http://www.skvare.com
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Using Rules Action to Create User Problem with Duplicate First and Last Names
April 19, 2013, 02:36:33 pm
Whoops, that action is not coming from civicrm rules integration its coming from this great sandbox project of Eileens'. http://drupal.org/sandbox/eileen/1923028


jackrabbithanna

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 3
  • Quick like bunny
    • http://www.skvare.com
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Using Rules Action to Create User Problem with Duplicate First and Last Names
April 29, 2013, 08:32:29 pm
That module is a handy module.


If you want to try to have more uniqueness for the user name then you can force the use of the email field.

alter the civicrm_entity.module file around line 519
Code: [Select]

//comment out next line
//$params['cms_name'] = $params['name'] = $user['name'] = !empty($contact['display_name'])? $contact['display_name'] : $params['mail'];
//And have this instead
$params['cms_name'] = $params['name'] = $user['name'] = $params['mail'];

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Using Rules Action to Create User Problem with Duplicate First and Last Names

This forum was archived on 2017-11-26.