Skip to content
Snippets Groups Projects
Commit b9910740 authored by Stella Power's avatar Stella Power Committed by Lev Tsypin
Browse files

#1781672 by stella: Ensure merge vars array exists before looping over it.

parent ff7c2f9c
No related branches found
No related tags found
No related merge requests found
......@@ -489,12 +489,14 @@ function mailchimp_lists_auth_newsletter_form(&$form, $list, $account) {
}
$mc_list = mailchimp_get_list($list->mc_list_id);
foreach ($mc_list['mergevars'] as $mergevar) {
// set the default value for merge fields if we have it
if ($mergevalues && isset($mergevalues[$mergevar['tag']]) && $mergevalues[$mergevar['tag']]) {
$mergevar['default'] = $mergevalues[$mergevar['tag']];
if (!empty($mc_list['mergevars'])) {
foreach ($mc_list['mergevars'] as $mergevar) {
// set the default value for merge fields if we have it
if ($mergevalues && isset($mergevalues[$mergevar['tag']]) && $mergevalues[$mergevar['tag']]) {
$mergevar['default'] = $mergevalues[$mergevar['tag']];
}
$form[$wrapper_key]['mergevars'][$mergevar['tag']] = mailchimp_lists_insert_drupal_form_tag($mergevar);
}
$form[$wrapper_key]['mergevars'][$mergevar['tag']] = mailchimp_lists_insert_drupal_form_tag($mergevar);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment