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.
Here we still have a prolem with the interests as they come without group-level from the API. So the inner foreach must throw a warning as you can see on the attached screenshot. There was a similir issue in 7.3 - discussed here: https://www.drupal.org/node/2632568
Comment | File | Size | Author |
---|---|---|---|
#10 | 2857646.patch | 824 bytes | drumm |
|
Comments
Comment #2
zuernBernhard CreditAttribution: zuernBernhard at UEBERBIT GmbH commentedComment #3
Rodeo.be CreditAttribution: Rodeo.be commentedI have tihs issue as well .. any solutions?
Comment #4
drummWe turned on batch processing for www.drupal.org, and started running into this with a mailchimp_lists field, running 7.x-5.1.
This causes the interests to not properly cache, so they all appear cleared if you go back to the form, until cron runs.
Comment #5
drummThe data I’m seeing come through to
$args['interests']
isSo I’m using PHP’s loose comparison,
if ($interests)
. Otherwise this is the same as zuernBernhard’s patch, with minor code style cleanup.Comment #6
drumm#2838871: "Invalid argument supplied for foreach() in mailchimp_lists_process_subscribe_form_choices()" error prevents interest group subscriptions/updates currently has the same patch.
Comment #7
drummComment #8
drummComment #9
rjacobsen0 CreditAttribution: rjacobsen0 at ThinkShout for Mailchimp commentedThis issue is a duplicate of https://www.drupal.org/project/mailchimp/issues/2838871. Contributors here have been credited.
Comment #10
drummReopening since the fix in #2838871-25: "Invalid argument supplied for foreach() in mailchimp_lists_process_subscribe_form_choices()" error prevents interest group subscriptions/updates didn’t look quite right.
This updates the if condition to match the patch in this issue.
$interest_group
is an array key which will never be itself an array.is_array($interests)
should be the right thing to be checking.Comment #13
samuel.mortensonThanks @drumm, LGTM.