Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1.3
-
Fix Version/s: 3.1.4
-
Component/s: None
-
Labels:None
Description
There is a MAX_CONTACTS_TO_PROCESS (default 1000) in CRM_Mailing_BAO_Job which I think is to reduce the work load of the server. This process limit cause a number of calls to api/v2/Acitivity.php civicrm_activity_create function.
In civicrm_activity_create function, it calls CRM_Activity_BAO_Activity::create. This function deleted all the activity_target records of the activity before recording activity target, which introduce the problem that processing more than 1000 contacts will delete the previous activity_target records of this activity.
For example, if there are 2120 recipients, it records 3 times to the activity_target table. First 1000, then deletes the first 1000 and records the second 1000, then delete the second 1000 and record the remaining 120 records.