Hi,

I tested the 7.x-1.0 and 7.x-1.x-dev version, but I got the same problem, I got an error message : "We were unable to unsubscribe you at this time. Please try again later."

When I checked the problem in _mailchimp_unsubscribe_user() I saw that you used $list as an object ($list->id) but when I check $list, it's an array.

I see that you used the object instead of array almost everywhere, do I missed something ?

CommentFileSizeAuthor
#2 unsubscribe_problem-1201186-1.patch915 bytesMoinax

Comments

Moinax’s picture

Here is the solution to fix this problem:

@@ -851,10 +851,10 @@ function _mailchimp_subscribe_user($list, $email, $merge_vars, $message = TRUE,
 function _mailchimp_unsubscribe_user($list, $mail, $message = TRUE, $q = NULL) {
   $success = FALSE;
   if ($q || $q = _mailchimp_get_api_object()) {
-    if (_mailchimp_is_subscribed($list->id, $mail, $q)) {
-      $success = $q->listUnsubscribe($list->id, $mail, FALSE, FALSE, FALSE);
+    if (_mailchimp_is_subscribed($list['id'], $mail, $q)) {
+      $success = $q->listUnsubscribe($list['id'], $mail, FALSE, FALSE, FALSE);
       if ($message && $success) {
-        drupal_set_message(t('You have unsubscribed from %list.', array('%list' => $list->name)));
+        drupal_set_message(t('You have unsubscribed from %list.', array('%list' => $list['name'])));
       }
     }
   }
Moinax’s picture

StatusFileSize
new915 bytes
dboulet’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
levelos’s picture

Component: Code » General
Status: Needs review » Closed (won't fix)