CRM-14865 - ensure contacts and participants arrays are keyed the same
authorJamie McClelland <jm@mayfirst.org>
Tue, 17 Jun 2014 18:19:51 +0000 (14:19 -0400)
committerJamie McClelland <jm@mayfirst.org>
Tue, 17 Jun 2014 18:19:51 +0000 (14:19 -0400)
To avoid:

Notice: Undefined offset: 1 in CRM_Event_Form_Participant->postProcess()
(line 1497...)

----------------------------------------
* CRM-14865: Prevent duplicate participants when using offline event registration
  https://issues.civicrm.org/jira/browse/CRM-14865

CRM/Event/Form/Participant.php

index 7b99f87ac7cf9e7487674407b8be591924ab6673..8fa680d13d05a2786d41fd240ee7202f66fb745d 100644 (file)
@@ -1005,6 +1005,10 @@ class CRM_Event_Form_Participant extends CRM_Contact_Form_Task {
           CRM_Core_Session::setStatus(ts("No participants were added."));
           return;
         }
+        // We have to re-key $this->_contactIds so each contact has the same
+        // key as their corresponding record in the $participants array that
+        // will be created below.
+        $this->_contactIds = array_values($this->_contactIds);
       }
     }