Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Cannot Reproduce
-
Affects Version/s: 4.6.6
-
Fix Version/s: 4.6.16
-
Component/s: None
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
After upgrading from 4.4 to 4.6 the person configured as the manual recipient on a scheduled reminder received 500 reminder emails.The scheduled reminder had previously caused a total of 34 past emails to go out.
I see that this contact was added to the action log as requiring an email in the query
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
SELECT c.id as contact_id, c.id as entity_id, 'civicrm_contact' as entity_table, 1 as action_schedule_id
FROM (civicrm_contact c)
LEFT JOIN civicrm_action_log reminder ON reminder.contact_id = c.id AND
reminder.entity_id = c.id AND
reminder.entity_table = 'civicrm_contact' AND
reminder.action_schedule_id = 1
WHERE c.is_deleted = 0 AND c.is_deceased = 0
AND c.id IN (2)
AND c.id NOT IN (
SELECT rem.contact_id
FROM civicrm_action_log rem INNER JOIN civicrm_membership e ON rem.entity_id = e.id
WHERE rem.action_schedule_id = 1
AND rem.entity_table = 'civicrm_membership'
)
GROUP BY c.id
;
And was then selected for a reminder for each matching membership with this
SELECT reminder.id as reminderID, reminder.contact_id as contactID, reminder.entity_table as entityTable, reminder., e.id as entityID, e. , mt.minimum_fee as fee, e.id as id , e.join_date, e.start_date, e.end_date, ms.name as status, mt.name as type
FROM civicrm_action_log reminder
LEFT JOIN civicrm_membership e ON e.id = reminder.entity_id
LEFT JOIN civicrm_membership_type mt ON e.membership_type_id = mt.id
LEFT JOIN civicrm_membership_status ms ON e.status_id = ms.id
WHERE reminder.action_schedule_id = 1 AND reminder.action_date_time IS NULL
AND (e.id = reminder.entity_id OR reminder.entity_table = 'civicrm_contact')
;
I'm doing a little digging on this & will try to add a test but I'm not really sure the correct behaviour exactly...