Details
-
Type: Bug
-
Status: Open
-
Priority: Trivial
-
Resolution: Unresolved
-
Affects Version/s: 4.7.15
-
Fix Version/s: None
-
Component/s: CiviCRM API, CiviEvent
-
Labels:
-
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