Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2658

Opt-out sometimes causes a warning to be displayed

    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.

      https://www.example.com/index.php?q=civicrm/mailing/optout&reset=1&jid=115&qid=137&h=ae8d24c3f12687b3d9dfda15b7af9840e329370f

      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.

        Attachments

          Activity

            People

            • Assignee:
              kiran.jagtap Kiran Jagtap
              Reporter:
              miknight Michael Knight
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: