The comment asks why the code appears to use of `$contactIds` and
`$form->contactIds` interchangeably. If you grep for calls to
`createActivities()`, all 3-ish callpaths do set `$contactIds` based on
`$form->contactIds` -- so they are the same.
```
// Look for calls to createActivities()
$ grep -r ::createActivities CRM/ Civi/ api/
CRM/Contact/Form/Task/PDFLetterCommon.php: self::createActivities($form, $html_message, $form->_contactIds);
CRM/Member/Form/Task/PDFLetterCommon.php: self::createActivities($form, $html_message, $contactIDs);
CRM/Contribute/Form/Task/PDFLetterCommon.php: self::createActivities($form, $html_message, $form->_contactIds);
// Look for calls to createActivities via CRM/Member/Form/Task/PDFLetterCommon
$ rgrep -r postProcessMembers\( CRM/ Civi/ api/
CRM/Member/Form/Task/PDFLetter.php: CRM_Member_Form_Task_PDFLetterCommon::postProcessMembers(
CRM/Member/Form/Task/PDFLetterCommon.php: public static function postProcessMembers(&$form, $membershipIDs, $skipOnHold, $skipDeceased, $contactIDs) {
```
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
- //@todo why are we using $form->_contactIds here & contactIds above - need comment
- foreach ($form->_contactIds as $contactId) {
+ foreach ($contactIds as $contactId) {
$activityTargetParams = array(
'activity_id' => empty($activity->id) ? $activityIds[$contactId] : $activity->id,
'contact_id' => $contactId,