Confirming from waitlist counts deleted contacts
To replicate:
- Create an event with a waitlist of 1.
- Register a new contact ("User 1") for the event through the public interface (anonymously).
- Delete the contact.
- register 2 more contacts through the public interface. Note how the deleted contact is NOT counted, and you can register User 2 for the event, and User 3 goes on the waitlist.
- Cancel User 2's registration and run the "Update Participant Statuses" scheduled job.
- User 3 will now receive an email to ask them to confirm they want to come off the waitlist. However, when you click the link, you're told that the event is full (because User 1, despite being deleted, is still counted).
The issue is CRM_Event_BAO_Participant::pendingToConfirmSpaces()
. Not only does it not count deleted contacts, but it appears (haven't tested) to not count correctly if an event registration counts for multiple people.
The solution is to remove this code and replace the one place it's called with a call to CRM_Event_BAO_Event::getParticipantCount()
.
I don't have time/funding to do this, but wanted to record my findings in case someone else encountered this problem.