Details
Description
It appears that the code which inserts uf_match records is ignoring contact type while matching on email addresses. I am able to replicate item 1 below - using these steps:
1. create user with email = info@civicrm.org
2. create Organization with email = info@civicrm.org
3. create Individual with email = info@civicrm.org
4. Run Synch Users to Contacts (from Admin > Manage)
Expected behavior - user is "linked" to the individual contact record.
Actual behavior - user is "linked" to the organization record.
I tried to recreate the second item below, but in my testing the registering user was linked to the Individual record with the matching email address as expected.
— original post from Jim Taylor -------------
The issue or Org being confused for Individuals is not just with Events but seemingly with the Drupal/CiviCRM sync script and Drupal User Registration. Two scenarios where we are seeing Drupal accounts linked to CiviCRM Organizations. In both cases an Organization and Individual contact have the same e-mail and the Organization's Contact ID is lower than that of the Individual.
1.) Running the User/Contact sync CiviCRM will link the Drupal account with the Org account.
2.) A person creates a user account through Drupal and uses and e-mail already in CiviCRM in an Organization's account the new Drupal account will be linked to the Organization's account.