Because of the way the synchronization process works with the UF_Match table, deleting records can be tricky business. If done in the incorrect order, your CiviCRM database can end up with a bunch of Junk contact records. Below is a best practice process for removing records, first the Drupal user record should be deleted then the CiviCRM record.
Process to Follow
Step 1 - Identify the Identify the Contact record(s) to be merged/removed in CiviCRM and note the Drupal User ID for the record to be removed.
Step 2 - Search for and locate the Drupal record for the CiviCRM Contact you are deleting that you identified in Step 1 and use the Cancel Account button to delete the Drupal User record.
Step 3 - Go back to CiviCRM and merge/delete the CiviCRM Contact record.
- Identify the Contact record(s) to be merged/removed in CiviCRM.
- Determine the record which is to be removed and note the Drupal User ID.
- From the Drupal People screen, locate the User record to be removed. Note that the Drupal ID number should match the User ID from the CiviCRM Contact record.
- At the bottom of the Edit/Account tab, choose Cancel account.
- Merge/Remove the CiviCRM Contact record(s) as normal in CivCRM.
Restoring a CiviCRM record from Trash
If you have accidently deleted a Contact record from CiviCRM, you should follow the process in the order outlined below to restore the contact and reestablish a Drupal User account.
Process to Follow
- Step 1 - Restore the CiviCRM Contact record from the trash.
- Step 2 - Establish the connection to a Drupal User account.
If you have not yet deleted the Drupal User account that was associated with the deleted CiviCRM record and you edit the Drupal User account (from Drupal) that was associated previously, Drupal will reestablish the link to the CiviCRM record.
If there is not an existing Drupal User account, you can create a new Drupal user account for the record through the normal CiviCRM process.
Note that the default "unsupervised" Individual rule is used when the syncronization takes place. Folks should plan their "drupal user registration" profile accordingly.
Rather than looking for the matching user in the cms - note that the user id number (in your example 7184) is a clickable link going to the user account, where you can delete it directly.
Good point! Thanks!
It *shouldn't* be too hard to create a Drupal Rule that disables the Drupal User on contact-trash & deletes the Drupal User on Contact Delete. I think the parts are there in the civicrm_entity module. The downside of the rule option is that there might be reasons not to want it