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 (Moderator: Dave Greenberg) »
  • Drupal/CiviCRM Duplicate User Registration Issue
Pages: [1]

Author Topic: Drupal/CiviCRM Duplicate User Registration Issue  (Read 2970 times)

hintbw

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
    • AzTEA
Drupal/CiviCRM Duplicate User Registration Issue
January 28, 2009, 08:06:55 am
The case goes like this:

User A creates Drupal Account A using email address A (home email) on the site and that matches with their CiviCRM account (which has a home (email account A) and work email address (email account b))

They go by a year without using the website to register for events and when they get on a year later, they have forgotten they created their account and go to create a new one.

This time User A creates Drupal Account B using email account b. Drupal of course doesn't have a problem because the user created a new account (i.e. different username) with a different email address. So Drupal permits the user account registration to occur. The CiviCRM match process occurs immediately thereafter and, because the user has registered with an email address that already belongs to a user in CiviCRM, it tosses back a fatal error with a backtrace, etc. (despite the fact that I have error reporting and backtrace turned off in the debugging preferences screen).

My question is what should happen if a user tries to register for a 2nd Drupal account using an email address already belonging to a CiviCRM contact that has a Drupal account linked to it.

Ideally the CiviCRM hook would compare before the user account is created and return a message something like "This email account is already linked to a Drupal user account, please check to see if you have already created a user account or contact ......".

Does anybody else run into this issue - how do you handle it?

Also, any reason why the backtrace and fatal error is showing up even with the preferences for those turned off? Shouldn't it return mention there was an error to the user and then maybe shoot an email with the corresponding backtrace and fatal error information to the site administrator?

---
Brett

hintbw

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
    • AzTEA
Re: Drupal/CiviCRM Duplicate User Registration Issue
January 28, 2009, 08:09:47 am
I'm running Drupal 6.8 and CiviCRM 2.1.4. Here's the backtrace and error information (I removed the offending email address from the error message to protect the innocent  :)):

/home/aztea/public_html/current/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 138
, handle,
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 912
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 966
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 574
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2394
/home/aztea/public_html/current/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1039
/home/aztea/public_html/current/sites/all/modules/civicrm/CRM/Core/DAO.php, insert, 279
/home/aztea/public_html/current/sites/all/modules/civicrm/CRM/Core/BAO/UFMatch.php, save, 242
/home/aztea/public_html/current/sites/all/modules/civicrm/CRM/Core/BAO/UFMatch.php, synchronizeUFMatch, 130
/home/aztea/public_html/current/sites/all/modules/civicrm/drupal/civicrm.module, synchronize, 376
/home/aztea/public_html/current/modules/user/user.module, civicrm_user, 22
/home/aztea/public_html/current/modules/user/user.module, user_module_invoke, 1374
/home/aztea/public_html/current/modules/user/user.module, user_authenticate_finalize, 1350
/home/aztea/public_html/current/modules/user/user.module, user_authenticate, 1309
/home/aztea/public_html/current/includes/form.inc, user_login_authenticate_validate, 766
/home/aztea/public_html/current/includes/form.inc, form_execute_handlers, 714
/home/aztea/public_html/current/includes/form.inc, _form_validate, 579
/home/aztea/public_html/current/includes/form.inc, drupal_validate_form, 398
/home/aztea/public_html/current/includes/form.inc, drupal_process_form, 119
/home/aztea/public_html/current/modules/user/user.module, drupal_get_form, 729
, user_block,
/home/aztea/public_html/current/includes/module.inc, call_user_func_array, 450
/home/aztea/public_html/current/modules/block/block.module, module_invoke, 473
/home/aztea/public_html/current/includes/theme.inc, block_list, 1569
, theme_blocks,
/home/aztea/public_html/current/includes/theme.inc, call_user_func_array, 617
/home/aztea/public_html/current/includes/theme.inc, theme, 1763
, template_preprocess_page,
/home/aztea/public_html/current/includes/theme.inc, call_user_func_array, 658
/home/aztea/public_html/current/index.php, theme, 36

unrecoverable error
   Sorry. A non-recoverable error has occurred.

   DB Error: already exists

   Database Error Code: Duplicate entry '1841' for key 2, 1062

   Return to home page.

Error Details:

Array
(
   [callback] => Array
       (
           
  • => CRM_Core_Error
  • [1] => handle
           )

       
Code: [Select]
=> -5
   [message] => DB Error: already exists
   [mode] => 16
   [debug_info] => INSERT INTO civicrm_uf_match (uf_id , uf_name , contact_id ) VALUES ( 479 , 'email address removed' ,  1841 )  [nativecode=1062 ** Duplicate entry '1841' for key 2]
   [type] => DB_Error
   [user_info] => INSERT INTO civicrm_uf_match (uf_id , uf_name , contact_id ) VALUES ( 479 , 'email addressed removed' ,  1841 )  [nativecode=1062 ** Duplicate entry '1841' for key 2]
   [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_match (uf_id , uf_name , contact_id ) VALUES ( 479 , 'email address removed' ,  1841 )  [nativecode=1062 ** Duplicate entry '1841' for key 2]"]
)
---
Brett

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Drupal/CiviCRM Duplicate User Registration Issue
January 28, 2009, 10:49:32 am

1. this is a bug, so please file an issue and we should fix it for 2.2 :)

2. however, the error indicates that the email addresses is already present in the db and hence the constraint error, whereas your use case suggests that the user has entered a different email address. Can u clarify. Would be great if we can figure out how we have replicated email address whereas drupal does not indicate the error. Can you reproduce this error on our demo or sandbox server

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Drupal/CiviCRM Duplicate User Registration Issue

This forum was archived on 2017-11-26.