Notice : Undefined property: stdClass::$required in mailchimp_insert_drupal_form_tag () after update 7.x-3.x => 7.x-4.8

Created on 21 March 2017, over 8 years ago
Updated 9 July 2025, 25 days ago

I got Notice errors after update to the latest version of mailchimp

Notice : Undefined property: stdClass :: $ required in mailchimp_insert_drupal_form_tag () (line 1504 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ DEFAULT_VALUE in mailchimp_insert_drupal_form_tag () (line 1505 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ type in mailchimp_insert_drupal_form_tag () (line 1508 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ required in mailchimp_insert_drupal_form_tag () (line 1504 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ DEFAULT_VALUE in mailchimp_insert_drupal_form_tag () (line 1505 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ type in mailchimp_insert_drupal_form_tag () (line 1508 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ required in mailchimp_insert_drupal_form_tag () (line 1504 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ DEFAULT_VALUE in mailchimp_insert_drupal_form_tag () (line 1505 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).
Notice : Undefined property: stdClass :: $ type in mailchimp_insert_drupal_form_tag () (line 1508 of /var/www/drupal/sites/all/modules/contrib/mailchimp/mailchimp.module ).

Could be simply fixed by adding ternary operators at lines 1503, 1504, 1505 and 1508. Like this (lines 1501 - 1508):

  $input = array(
    '#title' => t('@mergevar', array('@mergevar' => $mergevar->name)),
    '#weight' => isset($mergevar->display_order) ? $mergevar->display_order : '',
    '#required' => isset($mergevar->required) ? $mergevar->required : '',
    '#default_value' => isset($mergevar->default_value) ? $mergevar->default_value : ''
  );
    
  $mergevar->type = isset($mergevar->type) ? $mergevar->type : '';
📌 Task
Status

Closed: won't fix

Version

4.8

Component

General

Created by

🇬🇧United Kingdom andrew dolgov

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States xenophyle

    Thanks for submitting this ticket — and sorry we didn’t get back to you about it sooner. We are cleaning up old issues and issue for old versions and are going to close this one. If this issue is still relevant for you, please re-open it and update the “Version” field, and include any updates to the behavior you are seeing.With a smaller issue queue, we’ll have an easier time getting back to you.

Production build 0.71.5 2024