User account form action not passing along contact id correctly possibly leading to duplicate contacts
Overview
When submitting the back office user account creation user contact action the contact id of the user you are creating the account for is not properly passed along and can depending on your unsupervised dedupe rule create duplicate contact record
Reproduction steps
- Click on Contacts -> Find and Merge Duplicate Contacts and edit the Unsupervised Individual rule to change it from just email to use first and last name as well
- Navigate to an individual's record that doesn't have a CMS user account
- Select Actions -> Create User Record
- Possibly / likely receive a fatal error due to duplicate record in civicrm_uf_match, find that a duplicate contact has been created
Current behaviour
Duplicate contact is created when the CMS record is created
Expected behaviour
No Duplicate contact is created and the CMS account is properly connected to the contact you are creating the user account for
Environment information
- CiviCRM: 5.26.0
- PHP: 7.1_
- CMS: Drupal 8