I just did a clean install on a Drupal Commerce install of 7.x-3.0-alpha1 and everything works right up until I add a product to the cart or modify the shopping cart on the /cart page. Now I am getting these messages:

This appears on a Node:
Notice: Undefined property: stdClass::$type in mailchimp_lists_entity_delete() (line 43 of /var/www/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).
Notice: Undefined index: flagging in mailchimp_lists_entity_delete() (line 43 of /var/www/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).
Warning: in_array() expects parameter 2 to be array, null given in mailchimp_lists_entity_delete() (line 43 of /var/www/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

This appears on the /cart page after removing a product from the cart:
Notice: Undefined index: commerce_line_item in mailchimp_lists_entity_delete() (line 43 of /var/www/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).
Warning: in_array() expects parameter 2 to be array, null given in mailchimp_lists_entity_delete() (line 43 of /var/www/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Here is the offending code:

function mailchimp_lists_entity_delete($entity, $type) {
  40   // Check for mailchimp subscription fields and unsubscribe accordingly.
  41   $fields = field_info_fields();
  42   foreach($fields as $field) {
  43     if ($field['type'] == 'mailchimp_lists_subscription' && in_array($entity->type, $field['bundles'][$type])) {
  44       $instance = field_info_instance($type, $field['field_name'], $entity->type);
  45       mailchimp_lists_process_subscribe_form_choices(array('subscribe' => FALSE), $instance, $field, $entity);
  46     }
  47   }
  48 }

What's crazy about this is I have a field called field_newsletter_preferences of type "Mailchimp Subscription" on my users table and no where else.

Any ideas?

Comments

gcb’s picture

You can delete the function "mailchimp_lists_entity_delete" from mailchimp_lists.module to work around this. Be sure to clear cache. This function is going to be re-written or removed shortly.

gcb’s picture

Status: Active » Closed (fixed)

fixed in dev.