From a7aa44549c5dc483ea8df3e0f27ec83cd47ac9d3 Mon Sep 17 00:00:00 2001 From: Chamil Wijesooriya Date: Fri, 19 Jul 2019 17:27:19 +0100 Subject: [PATCH] dev/core#1135 Participants having multiple roles affects maximum event registration count --- CRM/Event/BAO/Participant.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 9819a2712f..de47df6ba3 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -388,7 +388,8 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { $escapedRoles[] = CRM_Utils_Type::escape($participantRole, 'String'); } - $where[] = " participant.role_id IN ( '" . implode("', '", $escapedRoles) . "' ) "; + $regexp = "([[:cntrl:]]|^)" . implode('([[:cntrl:]]|$)|([[:cntrl:]]|^)', $escapedRoles) . "([[:cntrl:]]|$)"; + $where[] = " participant.role_id REGEXP '{$regexp}'"; } $eventParams = [1 => [$eventId, 'Positive']]; -- 2.25.1