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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can't create Drupal user record from Individual record
Pages: [1]

Author Topic: Can't create Drupal user record from Individual record  (Read 2195 times)

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
Can't create Drupal user record from Individual record
April 27, 2012, 06:02:58 pm
Drupal 6, Civi 4.1.2
While logged in as the administrator I get an error when I try to create a Drupal User Record using the Action drop-down in an Individual Contact record.

Clicking on the Create User Record link brings up the form to create a Username and password, and correctly checks the availability of the user name.

However when I click the Add button I get an error "This email is already registered. Please select another email."

This happens with any Individual record I choose, and I have checked my Drupal users to make sure that the email is not registered to an existing Drupal User.

Am I misunderstanding something obvious?

(The demo server doesn't have the functionality to test this).
There are times I love technology...and then there are times I *love* technology :-)

matthew

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.x
Re: Can't create Drupal user record from Individual record
May 18, 2012, 02:59:49 pm
I was running CiviCRM 4.1.1 on Drupal 7 and this was working.

I downgraded to CiviCRM 4.1.1 on Drupal 6 and it stopped working, with the error:
"This email is already registered. Please select another email."

I'd say it is a bug.  Interestingly, even in Drupal 7, after creating the CMS user in CiviCRM, I would have to reset the user's password in Drupal before the user could log in.  So even with Drupal 7 it was not working perfectly.

It seems that CiviCRM synchronizes with Drupal via the email address.  So if you add a Drupal user with an email address that matches a Contact's record, they will magically bind together when the user logs in.  At least this seems to be the case in Drupal 6.
« Last Edit: May 18, 2012, 03:01:26 pm by matthew »

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
Re: Can't create Drupal user record from Individual record
May 19, 2012, 04:00:32 am
Hi Matthew - I haven't tried Civi on Drupal 7 yet. Maybe next development ! I bulk imported all my Civi contacts into Drupal as users using node_import (quite easy) but had hoped to be able to do subsequent ones from inside civi. Sadly it doesn't work in 4.1.2. I'm holding thumbs it gets on the priority list to be fixed in the next update.
There are times I love technology...and then there are times I *love* technology :-)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can't create Drupal user record from Individual record
June 13, 2012, 07:18:44 pm
I have a patch that makes this work in drupal 6 - but it's one of those patches which makes you think "how could it possibly work in Drupal 7 without this patch. The function 'checkUserNameEmailExists' is being called without the email being passed in

Index: CRM/Contact/Form/Task/Useradd.php
===================================================================
--- CRM/Contact/Form/Task/Useradd.php   (revision 40705)
+++ CRM/Contact/Form/Task/Useradd.php   (working copy)
@@ -146,7 +146,10 @@
   public function usernameRule($params) {
     $config       = CRM_Core_Config::singleton();
     $errors       = array();
-    $check_params = array('name' => $params['cms_name']);
+    $check_params = array(
+      'name' => $params['cms_name'],
+      'mail' => $params['email']
+    );
     $config->userSystem->checkUserNameEmailExists($check_params, $errors);
 
     return empty($errors) ? TRUE : $errors;
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can't create Drupal user record from Individual record
June 13, 2012, 07:22:44 pm
I have created a ticket

http://issues.civicrm.org/jira/browse/CRM-10380
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
Re: Can't create Drupal user record from Individual record
June 15, 2012, 01:39:59 am
Hi Eileen - this is great. Many thanks !
I'll install tonight with the 4.1.3 security update.
There are times I love technology...and then there are times I *love* technology :-)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can't create Drupal user record from Individual record
June 15, 2012, 01:41:56 am
OK - it worked for me - but maybe not Sarah - so if you verify it works for you I'll commit it
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Can't create Drupal user record from Individual record
June 15, 2012, 07:42:21 pm
What should I investigate to see why its not working for me?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
Re: Can't create Drupal user record from Individual record
June 16, 2012, 01:31:14 am
Hi Eileen - the patch worked fine for me on 4.1.2 / D6.
Many thanks again.
There are times I love technology...and then there are times I *love* technology :-)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can't create Drupal user record from Individual record
June 18, 2012, 02:52:00 pm
Sarah,

My best guess is that some other module (like captcha or mollum) is playing a part for you?

The function is CRM/Utils/System/Drupal6::checkUserNameEmailExists (off the top of my head)

Eileen
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can't create Drupal user record from Individual record

This forum was archived on 2017-11-26.