Problem/Motivation

When "Connect users to RedHen contacts" is checked, it's possible to accidentally connect multiple RedHen Contacts to a single Drupal User.

Steps to reproduce

1. Create a contact connected to a user with the email test@example.com
2. Then run the following code:

  $contact = \Drupal\redhen_contact\Entity\Contact::create([
    'type' => 'general',
    'email' => 'test@example.com',
  ]);
  $contact->save();

3. The duplicate contact is created and attached to the user account test@example.com, resulting in two contacts connected to the same user.

Proposed resolution

Patch below.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

wxactly created an issue. See original summary.

wxactly’s picture

gcb’s picture

Status: Active » Reviewed & tested by the community

  • gcb committed 63fa12e5 on 2.x
    Issue #3492496 by wxactly: Multiple contacts connected to a single user
    
gcb’s picture

Status: Reviewed & tested by the community » Fixed

  • gcb committed 63fa12e5 on controller_cleanup
    Issue #3492496 by wxactly: Multiple contacts connected to a single user
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.