2

We use Drupal and have a lot of users with more than one email address (but not within the Drupal accounts) - they forget they registered with one email and try to use another to login and failing that, use this other address to create another account. We thus get duplicate accounts.

To add better account information etc to Drupal, i.e. to store proper address details and more than one email address, I thought I would try out CiviCRM.

Last week I set up a local dev environment (Ubuntu 14.04, CiviCRM 5.5.2, Drupal 7.59, PHP5.6.37, MySQL 5.5.61) and synced users. I amended the Name and Address profile to customise it to our requirements and so that users could amend their address details.

I am 100% sure that when I tested someone trying to register through the (now amended) Drupal registration form, it would reject the registration if the email address was already in another field, like 'Other' or 'Home'. I could also login to Drupal with any other the email addresses a CiviCRM user had in their record.

I have rebuilt my environment (to prepare for a pilot) and the duplicate checking and login behaviour has now stopped... I did a demo to a colleague and so I was not dreaming this! I do not remember specifically 'enabling' duplicate checking etc, but it was working exactly as we needed and I was really pleased. It also made logical sense that, as CiviCRM hooks into to the registration screen etc, that somewhere in the background there would be a check on existing email addresses etc.

The other thing I notice is that I am unable to add other email addresses to the Name and Address profile - they just do not display. They do in the user profile (from Drupal) so I am assuming that this is a permissions thing somewhere.

Rebuilding has clearly reset something - does anyone anyone have any ideas as to why this behaviour has changed?

Many thanks

Martin

0

1 Answer 1

2

On the Drupal side, there is a Multiple Email Address module that will allow for multiple emails to be associated with the same user account (not sure if you can configure specific email fields to map to the corresponding location types in Civi such that whatever changes/additional emails are added on the Drupal side would be communicated to the same contact record on the Civi side - you might want to check on that). The first paragraph at the link above indicates the following:

Only one e-mail address is considered to be the "primary" email address, and will continue to behave as normal. Non-primary accounts are mostly functionally meaningless, except that during user registration any e-mail address registered to a user cannot be used to create a new account.

The Multiple Email Address module will in effect prevent duplicate contacts from being created in Civi as well.

Without this module, there is a 1:1 relationship between a drupal user account and a primary email address of a Civi contact record (keep in mind, the primary email address can be of any location type - if you were able to login with more than one email address without having the above module installed, it may be that you have duplicate contact records in Civi with a different email location set as primary - you can check the civi contact IDs associated with the drupal user IDs directly in the database in civicrm_uf_match). With regards to duplicate matching, the default behavior is as follows:

  • When a user creates a Drupal user account using anything other than a primary email address of an existing Civi contact record, a new contact record is created in Civi
  • If a user attempts to login with an email address that is not their primary email address, they will not succeed
  • Conversely, Drupal does not allow a duplicate user record to be created for the same primary email address

You mention additional email fields are not displaying in the Name and Address profile - I am assuming this is a Civi profile configured with email fields of various location types - the same behavior happens on my end and I have a faint recollection of this being a programmed behavior to avoid overwriting the primary email address - but not 100% sure about this - anyone else who can confirm that please chime in.

Hope this helps!

2
  • Hi Tamar - thank you, that is really helpful. I have considered this and decided to go down a more custom programmatic route that suits where we heading strategically. I am doing additional validation on the forms that we have in the system for adding new users (we have a custom area for other business activities). when it is tested, I'll post it as it may be of interest to others. Thanks again. Martin
    – ChumKui
    Sep 26, 2018 at 13:24
  • Glad I could help! Sep 26, 2018 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.