Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After upgrading to 7.x-4.0, I'm getting a fatal error when visiting a page with a mailchimp signup block:
PHP Fatal error: Cannot use object of type stdClass as array in .../mailchimp/modules/mailchimp_signup/includes/mailchimp_signup.admin.inc on line 160
Sure enough, you can see in the code that $mergevar is an object, and so it needs the name assigned as an object property and not an array member.
This fixes it:
@@ -157,7 +157,8 @@ function mailchimp_signup_form($form, &$form_state, MailchimpSignup $signup) {
foreach ($list_mergevars as $mergevar) {
$form_state['mergevar_options'][$mergevar->tag] = $mergevar;
if (!$mergevar->public) {
- $form_state['mergevar_options'][$mergevar->tag]['name'] .= ' (private)';
+ $form_state['mergevar_options'][$mergevar->tag]->name .= ' (private)';
};
}
}
Comment | File | Size | Author |
---|---|---|---|
#2 | mailchimp-php-fatal-error-2707763.patch | 747 bytes | freelock |
Comments
Comment #2
freelockPatch attached.
Comment #3
freelockUpdating status and title...
Comment #5
ruscoe CreditAttribution: ruscoe at ThinkShout commentedGreat catch, thank you. I've committed this and we'll get a new release out with some other fixes later today.