Needs review
Project:
UberCart MailChimp
Version:
6.x-3.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Nov 2009 at 11:12 UTC
Updated:
14 Sep 2012 at 18:47 UTC
Jump to comment: Most recent file
I get the following error when reviewing the order
warning: Invalid argument supplied for foreach() in /sites/all/modules/uc_mailchimp/uc_mailchimp.module on line 110.
Comments
Comment #1
longwavePatch attached that fixes this issue.
Comment #2
snufkin commentedAdding two more wrappers when _uc_mailchimp_call_api is returning something and we loop through it via a foreach. Also contains patch in #1.
Comment #3
guypaddock commented*Ahem* This is still an issue in 3.0... Can we get the maintainers to commit this fix?
Comment #4
guypaddock commentedThe attached patches further extend the intent of the array_wrap.patch to both
uc_checkout_pane_mailchimp()anduc_mailchimp_action_ecom_update()in version 3.0.The patches also correct the whitespace in the
uc_checkout_pane_mailchimp()anduc_mailchimp_action_ecom_update()functions to adhere to Drupal coding standards.Comment #5
guypaddock commentedAttached are the above two patches rolled into one for the DRUPAL-6--2 branch.
Comment #6
BenK commentedSubscribing...
Comment #7
BenK commentedSubscribing...
Comment #8
arcaneadam commentedI'll take a look at this also this weekend.
Comment #9
vladgur commentedThe patch doesnt work in latest, 6-3 version of the module.
subscribing
Comment #10
vladgur commentedThe patch doesnt work in latest, 6-3 version of the module.
subscribing
Update: what i meant to say, patch in #5 doesnt work, patches in #4 work :)
Comment #11
eojthebraveRe-rolled for 6.x-3.0, includes fix for invalid arguments and formatting for both uc_checkout_pane_mailchimp() and uc_mailchimp_action_ecom_update() functions.
Tested and working well.
Comment #12
rerooting commentedI am still getting this error with 6.x-3.0 - what am i doing wrong?
Warning: Invalid argument supplied for foreach() in uc_checkout_pane_mailchimp() (line 113 of /var/www/(site)/sites/all/modules/uc_mailchimp/uc_mailchimp.module).Comment #13
scresante commentedThe patch mentioned in #4 fixes the warning message.
This patch is not included in release 6.x-3.0 of uc_mailchimp, which hasn't been updated since this patch was posted.
Using Drupal version 6.20 and uc_mailchimp 6.x-3.0, patch in #5 does not work.
Comment #14
infosemantics commentedI've downloaded the patches from post #4 in this thread but when I look at the code there are lots of extra + and - characters at the beginning of each line. Not being a programmer, I'm a little unsure of what to do with these patch files.
Do I just paste the code from the patch files into the uc_mailchimp.module to replace the relevant functions? Do I have to remove all the extra line characters first?
Is there perhaps a cleaner way to do this, perhaps by downloading an updated version of uc_mailchimp.module that has all the fixes already included?
Comment #15
ktf commentedI fixed the error on line 113 by simply disabling the checkout pane altogether (I don't use it anyway). But a simple is_array() check will accomplish the same thing as well.
For the error on line 301, I used the attached patch. Maybe some of these will get committed one day :)