Skip to content

Notice: Undefined index: type #36

@PetitGrigri

Description

@PetitGrigri

When a subscribed member from a list have been deleted from mailchimp (with "PERMANENTLY DELETE").

If you try to subscribe this member again, the mailchimp api response do not contain the "type" field.

e.g :

[
  "title" => "Forgotten Email Not Subscribed"
  "status" => 400
  "detail" => [email protected] was permanently deleted and cannot be re-imported. The contact must re-subscribe to get back on the list."
  "instance" => "9042d84b-3xc0-4b75-a7c7-f0efbx225328"
]

This causes an error in the "throwMailchimpError" method of the ListRepository" which expects this data :

    private function throwMailchimpError(array $errorResponse)
    {
        $errorArray = json_decode($errorResponse['body'], true);

        if (is_array($errorArray) && array_key_exists('errors', $errorArray)) {
            throw new MailchimpException(
                $errorArray['status'],
                $errorArray['detail'],
                $errorArray['type'],
                $errorArray['title'],
                $errorArray['errors'],
                $errorArray['instance']
            );
        } else {
            throw new MailchimpException(
                $errorArray['status'],
                $errorArray['detail'],
                $errorArray['type'],
                $errorArray['title'],
                null,
                $errorArray['instance']
            );
        }

This error occurs with the version 1.3.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions