Details
-
Type: Bug
-
Status: Open
-
Priority: Trivial
-
Resolution: Unresolved
-
Affects Version/s: 4.6.4
-
Fix Version/s: Unscheduled
-
Component/s: None
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Epic Link:
-
Funding Source:Needs Funding
Description
Send Email to Contacts task from Find Participants - if multiple registrations selected for the same contact, we get a notice (see below), AND only one email is sent. We should send an email for each registration (as Tim notes in his comment below).
— Original Post —
When you use the mailing action (mail to participants) on the participant overview a notice appears in a specific situation.
Notice: Undefined offset: 147 in CRM_Contact_Form_Task_EmailCommon::buildQuickForm() (line 229 of /sites/all/modules/civicrm/CRM/Contact/Form/Task/EmailCommon.php).
To reproduce:
-Register contact A for two different events.
-Remove mailadres from contact or mark deceased
-Search participant for different event so contact A shows up in result twice (once for both events).
-Mail to participants (including double participant).
Now the notice shows.
The problem lies inside CRM_Contact_Form_Task_EmailCommon::buildQuickForm(&$form) method. This common class is used in CRM_Event_Form_Task_Email
This method removes the 'deceased / no mailing' contact-ids from the selection before making the form. It howerver removes the first contact-id, before checking the rest. In a participant selection a contact id could however appears twice. Which makes the unsetting done too early. We unset the contact id, and try to iterate through it afterwards.
A solution according to me is split up the buildform method, to get the validation in a seperate method, that way we could override the validation for the participant task.
i'll create a PR.