Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 1.9
-
Fix Version/s: 2.0
-
Component/s: None
-
Labels:None
Description
When clicking an opt-out link in an email, e.g.
and then clicking the 'Optout' button, the action is performed successfully. However, a warning is produced:
warning: Invalid argument supplied for foreach() in /home/example/public_html/modules/civicrm/CRM/Mailing/Event/BAO/Unsubscribe.php on line 265.
Looking through the code, there are multiple calls to CRM_Mailing_Event_BAO_Unsubscribe::send_unsub_response() with the $groups parameter set to NULL. This patch will skip the problematic foreach loop if $groups is not an array, preventing the warning.