Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20151

Duplicate participant registrations not allowed by GUI, but allowed by Participant.create API

    Details

    • Versioning Impact:
      Major (incompatible API change)
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      If you try to subscribe the same contact twice for the same event, using the GUI, you get an error message. Which seems right.
      But you can subscribe the same contact twice using the Participant.create API.

      So this might be a bug in the API.

      I created a test for this, which I will upload. But we can't easily fix this, because this would create other failures in the unit tests. E.g. in the setup of ParticipantTest the same contact is subscribed twice.

      You can see this effect by creating a unique index, like this:

      ALTER TABLE civicrm_participant ADD UNIQUE INDEX index_contact_id_event_id(contact_id, event_id);

      I'm not sure whether this is really a bug. But I'll post it anyway, so that I can link to it in our code

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              johanv Johan Vervloet
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: