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.
Running on a host that has php 5.2.17. Mailchim is configured to display interest groups on the registration form. This causes php warnings in check_plain() in bootstrap.inc when it does the following:
if ($php525) {
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}
I tracked this down to _mailchimp_interest_groups_element() adding an empty array for the default element. I'm not sure if this is a mailchimp coding issue or a bug in the forms api but I worked around it by changing the interests groups form element to
$element['interest_groups_' . $list_id][$group['id']] = array(
'#type' => $field_type,
'#title' => t('@name', array('@name' => $group['name'])),
'#multiple' => FALSE,
'#options' => $options
);
// adding an empty default value causes form api to generate
// php warnings by passing an array to check_plain
if (!empty($default)) {
$element['interest_groups_' . $list_id][$group['id']]['#default_value'] = $default;
}
I'm attaching a patch that fixes this issue.
Comment | File | Size | Author |
---|---|---|---|
mailchimp.module.patch | 1.25 KB | bkat | |
Comments
Comment #1
nrackleff CreditAttribution: nrackleff commented“And now our watch [for support of the 6.x version of the MailChimp module] has ended…” With the end of Drupal 6 support, I’m sad to say we too must turn the page.
Fret not! The 7.x-4.x and 8.x versions come highly recommended. Both are using Mailchimp’s new API 3.0 and are being actively maintained. “What is dead may never die, but rises again, harder and stronger!”