The 'mailchimp_lists' variable gets double-serialized, can it just be single-serialized? In Drupal 6 any arrays that are saved with variable_set() are automatically serialized, so the following lines could be changed:

in mailchimp.module, from:

  $lists = unserialize(variable_get('mailchimp_lists', array()));

to:

  $lists = variable_get('mailchimp_lists', array());

remove:

    $all_lists = unserialize($all_lists);

from:

  $data = variable_get('mailchimp_lists', NULL);
  $lists = array();
  if (!empty($data)) {
    $lists = unserialize($data);

to:

  $lists = variable_get('mailchimp_lists', array());
  if (!is_array($lists)) {
    $lists = array();
  }
  if (!empty($data)) {

in mailchimp.admin.inc, from:

          $saved_list = unserialize(variable_get('mailchimp_lists', NULL));

to:

          $saved_list = variable_get('mailchimp_lists', NULL);

from:

  variable_set('mailchimp_lists', serialize($lists));

to:

  variable_set('mailchimp_lists', $lists);
CommentFileSizeAuthor
#1 mailchimp-n965088.patch4.05 KBdamienmckenna

Comments

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new4.05 KB

Here you go.

levelos’s picture

Status: Needs review » Fixed

Thanks for the patch, all set. http://drupal.org/cvs?commit=460970

Status: Fixed » Closed (fixed)

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