I've found the same error many times on the logs at the same time a webhook from Mailchimp is being treated.
To reproduce create a list in MC without groupings.
This is the error: Missing Groupings in member
And the $data received from MC
Array
(
[email] => mcbs10@etikal.org
[id] => 5ccd842840
[euid] => 5ccd842840
[email_type] => html
[ip_signup] =>
[timestamp_signup] =>
[ip_opt] => 117.207.113.125
[timestamp_opt] => 2015-05-03 06:27:40
[member_rating] => 2
[info_changed] => 2015-05-03 06:27:40
[web_id] => 128372045
[leid] => 128372045
[language] =>
[list_id] => 14da8415eb
[list_name] => Test
[merges] => Array
(
[EMAIL] => mcbs10@etikal.org
[AVNAME] => back sync 10
[COMMUNITY] => back sync 10
[MLISTNO] => back sync 10
[ROR] => back sync 10
[RREGISTER] => back sync 10
[RTHEME] => back sync 10
[ALC] => back sync 10
)
[status] => subscribed
[timestamp] => 2015-05-03 06:27:40
[is_gmonkey] =>
[lists] => Array
(
)
[geo] => Array
(
)
[clients] => Array
(
)
[static_segments] => Array
(
)
[notes] => Array
(
)
)
Apparently this errors happen because the $data received has no $data['merges']['GROUPINGS'].
The error is fired at mailchimp_lists.module on line 343.
Comments
Comment #1
cubeinspire commentedSolved it enclosing the foreach with an if isset.
Comment #2
joelpittetThis issue seems like a duplicate of this: #2478997: Warning: Invalid argument supplied for foreach() in _mailchimp_lists_subscription_has_changed()
@cubeinspire mind posting your fix over there?
Comment #3
cubeinspire commentedSure I repost over there. Bye
Comment #4
jami commentedPatch was applied in commit:
http://cgit.drupalcode.org/mailchimp/commit/?id=937e193
Thank you for the fix!