So I've actually stumbled upon a couple small notices while working on things. The first two occur when you submit a form that has an email field and the MailChimp field is tied to that email field, but you don't actually click the "Subscribe" checkbox for MailChimp. Basically in my use, I have a contact form where you can opt to sign up for the newsletter and if you do, it should use the email address field you provide in the form.
All I think we need is a check on the MailChimp field that will only run the code referenced if that checkbox is checked.
Notice: Undefined variable: email_address in webform_mailchimp_webform_submission_insert() (line 151 of /sites/all/modules/custom/webform_mailchimp/webform_mailchimp.module).
Notice: Undefined variable: email_address in webform_mailchimp_webform_submission_insert() (line 125 of /sites/all/modules/custom/webform_mailchimp/webform_mailchimp.module).
In light of the above notices, I opted to go with the option of having MailChimp field create the email field for me. I got the second notice below:
Notice: Undefined variable: size in _webform_render_mailchimp() (line 210 of /sites/all/modules/custom/webform_mailchimp/webform_mailchimp.inc).
Easy enough to fix, just commented out line 211 defining the size of the text field.
Comment | File | Size | Author |
---|---|---|---|
#3 | webform_mailchimp-email_address_variable_fallback-1415798.patch | 503 bytes | jnettik |
Comments
Comment #1
blackdog CreditAttribution: blackdog commentedI don't think this is an issue anymore. Can you confirm?
Comment #2
jnettikI'm still getting the error:
I think the problem is with the the if statement below starting on line 38.
It looks like you're checking that I'm not using a generated email field, which I'm not. Then checks if the checkbox was checked, which it wasn't. So the $email_address never gets created. I think there needs to be some way for users to submit an email address field without subscribing to the newsletter.
Comment #3
jnettikI uploaded a small patch with a fallback for $email_address. Seems to work for what I'm doing.
Comment #4
SchwebDesign CreditAttribution: SchwebDesign commentedthx this helped fix this issue for me as well!
Comment #5
blackdog CreditAttribution: blackdog commentedCommitted, thanks!