CRM-6996 Preventing duplicates when "allow multiple registrations from the same email address" option is checked

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3.2
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      Below is the spec on how would we like dupe checks to happen when "allow_same_participant_emails" ( allow multiple registrations from the same email address ) flag is turned on -

      1. Introduce a form rule in the "online registration form" which ensures that:

      • a default "fuzzy" dedupe rule exists for Individuals
      • an additional participant profile HAS to be selected

      When the "allow multiple registrations from same email" is checked, show a status message <div>:
      "In order to allow multiple registrations with the same email address, the default "Fuzzy" Dedupe Rule will be used to check for matching existing contact records and prevent duplicate registrations. This rule currently uses the following fields: $dupeField1, $dupeField2, $dupeField3. First and Last Name will be used to check for matches among the multiple participants being registered."
      (list all dupe field names)

      2. Fix our current code to NOT bypass dupe check for additional participants.
      IF allow_same_participant_emai is TRUE, use default "fuzzy" rule.
      ELSE use default "strict" rule.

      3. Note #2 will only do dupe checks with contacts present in DB and not among the contacts collected as additional participants. The code to check dupes among additional participants (based on email field only) already exists, but is skipped when "allow_same_participant_emails" flag is on. If this flag is on, we need to detect dupes among additional participants based on first and last name info.

      4. In post confirm step when saving all contacts from session to DB, turn off any de-duping since the assumption is that - by this point all deduping would have been already done in prior steps.

      Note: Check code against the "fail" cases reported by Xavier D in comments below.

      ======== Previous message ========
      Generally, we shouldn't create duplicate contacts in the online event registration flow - and the Register Multiple Contacts with the Same Email flag was intended to support registration of different people who shared an email address during a "Register Multiple Participants" (Additional Participants screens) flow. And the expected use case is that a profile is used to collect differentiating info (first, last name etc.). However, we don't enforce this expectation - so we might just be getting repeated email address w/o additional contact fields in the Additional Participant forms.

      Suggested fix:

      • If we are in the online "Register Multiple Participants" flow - leave the current behavior as is (assuming we are bypassing the duplicate checking in this case). So even if the only thing we collect at the contact level is email address - we allow it and create 1 contact -> 1 participant for each registration submitted.
      • Otherwise if singleton online registration, do duplicate check based on currently configured strict rule. If we find a matching contact who is already registered for that event then we redirect back to main registration form with our normal 'already registered' status:

      ======= Original Message =======
      Step to reproduce (as anonymous)
      Create an event with a first name+lastname profile and online registration
      Open a browser in private browsing mode
      Register to the event as John Doe jon@doe.com
      civi create a new contact+participant

      Open a new browser in private browsing mode
      Register to the event as John Doe jon@doe.com
      civi rightly see that's the same contact, but wrongly create a new participant on the same contact for the same event

      Expected result:
      error message: We couldn't process your registration, you were already registered.+display contact infos as set on the event

        Attachments

        1. patch.txt
          1.0 kB
          xavier dutoit
        2. patch.txt
          0.8 kB
          xavier dutoit

          Activity

          [CRM-6996] Preventing duplicates when "allow multiple registrations from the same email address" option is checked
          Kiran Jagtap added a comment -

          Have you enable "Allow multiple registrations from the same email address?"
          option from Manage Event -> Configure -> Online Registration section.

          thanks,

          kiran

          xavier dutoit added a comment -

          For me "Allow multiple registrations from the same email address?" mean that two different contacts (kiran & Dave), can have the same info@civicrm.org address and register to the same event.

          You seem to say that "Allow multiple registrations from the same email address?" means "Allow multiple registrations from the same contact?"

          I fail to imagine the point of that.

          X+

          Kiran Jagtap added a comment -

          If we have "Allow multiple registrations from the same email address?" option enabled.
          we should check for other contact params and apply Individual 'Strict' contact matching rule to get contact id.

          Neha Kulkarni added a comment -

          checked in r30388

          xavier dutoit added a comment -

          Hi,

          I'm not sure we tested the same thing, but I've been able (out of the box svn install of 3.3) to register twice John Doe john@doe.com (event with online registration & using the profile New individual)

          Is this what you tested ?

          xavier dutoit added a comment -

          I've just done it on sandbox.civicrm.org
          http://sandbox.civicrm.org/civicrm/event/manage/location?action=update&reset=1&id=8
          (anonymous session, different browsers)

          1) Registering John Doe john@doe.com

          2) Registering 2 participants:
          John Doe john@doe.com
          John Doe john@doe.com

          http://sandbox.civicrm.org/civicrm/event/search?reset=1&force=1&event=8&status=true

          It creates 3 different contacts!
          (instead of 3 registrations for the same contact)

          No good ;(

          Deepak Srivastava added a comment -

          Xavier,

          Issue has been fixed and sandbox has been updated. Could you do another check from your side before we close it.

          thanks

          xavier dutoit added a comment -

          Back to the beginning: I can register twice John Doe john@doe.com on the same event.

          The contact John doe has two participants (same status, same role) to the same event.

          xavier dutoit added a comment -

          RIght now tested on my local version (svn Updated to revision 30835)

          Tried on sandbox, but there is another issue (doesn't seem to get the profile), probably not as up to date on the svn ?

          Anyway, step to reproduces are the same (one event, online registration, new individual profile, allow multiple registration, same email).

          register (on one browser online registration) John doe john@doe.com
          register (on another browser online registration) John doe john@doe.com

          Result: one contact, two participants to the same event

          Expected result: error message "you are already registered..." on the second registration

          xavier dutoit added a comment -

          deepaks did mention that this bug was already present in previous versions, not only in 3.3.

          X+

          xavier dutoit added a comment -

          This adds a rule that doesn't create duplicates but modify the initial registration.

          xavier dutoit added a comment -

          The proper version

          xavier dutoit added a comment -

          So there is still an issue (if I properly understood Deepaks fix):

          allow multiple registration with same email+profile:

          1) John doe john@doe.com as the main participant register several participants, including John doe john@doe.com as an additional participant.

          you got John doe registered twice as a participant.

          (no good

          X+

          P.S. I know that users shouldn't do it, but they do, 3 yesterday did it, two more today. Keep in mind that some of them don't speak very well english, so they might not understand that you don't need to put yourself twice.

          Deepak Srivastava added a comment -

          Xavier,

          Please have another look and see if it works now.

          xavier dutoit added a comment -

          http://sandbox.civicrm.org/civicrm/event/register?&cid=0&reset=1&id=7

          First test: FAIL
          (register 2 participants, additionnal participant the same than the first participant)
          http://sandbox.civicrm.org/civicrm/event/search?reset=1&force=1&status=true&event=7
          (2 different contacts created, with same first+last+email)

          Event Information
          TEST CRM-6996
          When November 24th, 2010 7:34 AM
          Additional Participant Email(s)
          john@doe.com
          Registered Email
          john@doe.com
          New Individual
          First Name
          John
          Last Name
          Doe
          Participant Information - Participant 2
          New Individual
          First Name John
          Last Name Doe
          Email Address john@doe.com

          2) 2nd test: SUCCESS!

          http://sandbox.civicrm.org/civicrm/event/register?&cid=0&reset=1&id=7

          Registering again the same person John Doe john@doe.com

          Oops. It looks like you are already registered for this event. If you want to change your registration, or you feel that you've gotten this message in error, please contact the site administrator. You can also register another participant.

          Kurund Jalmi added a comment -

          Deepak please update the issue once specs is finalized

          David Greenberg added a comment -

          Based on IRC conversation w/ Xavier, updated the issue specification. For Online Registration form validation, if allow_same_participant_email TRUE - we just check that a default Fuzzy rule exists for Individual AND check that Additional participant profile is selected (i.e .we don't care if profile has first, last, etc. - that's up to the user to handle). This way if someone only wants to collect last name (for example) - they can.

          Ashwini Poharkar added a comment -

          Tested in r31248

            People

            • Assignee:
              Ashwini Poharkar
              Reporter:
              xavier dutoit

              Dates

              • Created:
                Updated:
                Resolved: