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.

CommentFileSizeAuthor
#1 warning-2482197-1.patch2.16 KBcubeinspire

Comments

cubeinspire’s picture

StatusFileSize
new2.16 KB

Solved it enclosing the foreach with an if isset.

joelpittet’s picture

Status: Active » Closed (duplicate)

This 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?

cubeinspire’s picture

Sure I repost over there. Bye

jami’s picture

Version: 7.x-3.3 » 7.x-3.4
Status: Closed (duplicate) » Fixed

Patch was applied in commit:
http://cgit.drupalcode.org/mailchimp/commit/?id=937e193

Thank you for the fix!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.