Closed (won't fix)
Project:
Mailchimp
Version:
7.x-3.x-dev
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2010 at 09:08 UTC
Updated:
4 Oct 2016 at 17:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Poieo commentedSeeing this issue as well. Except I'm seeing it when interest groups are included in the registration block. With interest groups I receive the error upon registration. Without, no error.
Comment #2
levelos commentedI still can't recreate. Have you tested with the latest dev snapshot?
Comment #3
Poieo commentedSeems to be working with the latest dev. The issue was with RC5.
Comment #4
levelos commentedGreat, I'm closing then.
Comment #5
netsensei commentedThis is not fixed.
I installed the Mailchimp module 2.0 (july 12th) but I got the same error too. The error is also not fixed in the dev version.
Upon closer review, it seems that the
_mailchimp_subscribe_anon_form()function builds an erroneous $form array when it comes to the INTERESTS form element. Depending on the field type, the #type property is set to either radios, checkboxes or something else. Nonetheless, the #options property is set in all cases.Apparently, the data from the listInterestGroups() call can also contain data with field type 'hidden'. The Form api doesn't allow an #options property for elements of type 'hidden'.
Hence the validation error.
Made an attempt to build a patch which works form me. But I'm not really acquainted with the MailChimp API to know what other field types (besides 'hidden', 'checkboxes' and 'radios') the call might trigger.
Comment #6
levelos commentedAccording the API documentation, listInterestGroups() only returns field types of checkbox, radio, select. Under what circumstance are you getting a hidden type back? Not clear on why an interest group would presented by MC would ever be hidden, and if it was, we should just discard it entirely, e.g.,
Comment #7
netsensei commentedYes, I've just taken a look into the interface. The group is set as "Hidden". I didn't see a setting to change it into something different.
Comment #8
levelos commentedTook a bit of a different approach, but fixed and committed to 6.2 branch.
Comment #10
Sinan Erdem commentedI am experiencing the same issue on the latest 7.x version. I have set some fields as hidden and not required from Mailchimp side. There are 5 of those fields. But when a user fills out a form in Drupal, it gives me 5 of those errors:
Comment #11
gcbSinan, can you clarify what sort of fields your are setting as "hidden" and how? I can only find a way to set fields as hidden when generating a Mailchimp List Form using the Mailchimp interface (/lists/designer/ on my MC account). This form has nothing to do with the Drupal Mailchimp module, though, but is instead a way to get subscribe forms embedded using nothing but basic HTML.
Also, you have tagged this under 2.9 but stated that you are on the latest version, which is 2.10. If that's true, please select the correct version in the drop-down (it's alphabetical so it shows up between 2.1 and 2.2).
Comment #12
Sinan Erdem commented@gcb,
I am sorry, I now see that I am using 7.x-2.7.
Yes, I am setting the fields (dropdown or radios) as hidden on that Mailchimp List Form. When I do that, Drupal form doesnt show those hidden items. The output of a hidden field on Drupal form becomes:
Comment #13
achilleas01 commentedHello,
we have added the chargebee service and the mailchimp module adds some hidden fields to the drupal form as
the following HTML code shows:
When you submit the form it produces the error
An illegal choice has been detected. Please contact the site administrator.
An illegal choice has been detected. Please contact the site administrator.
An illegal choice has been detected. Please contact the site administrator.
An illegal choice has been detected. Please contact the site administrator.
I then changed the code of mailchimp/modules/mailchimp_lists/mailchimp_lists.module
in line 532 i added this to exclude checking of these hidden fields
$tagnames = array('LNAME','SUB_HANDLE','MMERGE10','IS_TRIAL','PLAN_CODE','PLAN_NAME','SUB_SINCE','SUB_STATUS','TRIAL_END');
if(!in_array($mergevar['tag'], $tagnames)) {
and i bypass them and the error is gone.
Can you help us to find a better solution to avoid these error?
Thank you
Comment #14
gcbIt looks like this issue occurs when plugins are added to your mailchimp service? Interesting. The latest Development release (which should soon become 7.x-2.11) has configuration options to change the fields made available to anonymous users completing these forms. Can you try it out and tell us if the issue persists? if you can work around it by removing those fields on the list configuration page for anonymous-allowed lists?
Comment #15
luksakI encountered this error as well. Debugging revealed, that somewhere
#default_valueis being set for merge fields. If this happens for radios which was my case, this throws an error when validating because is#default_valueempty and therefore is not an allowed value. My merge field was calledstoreand therefore this inside ahook_form_alter()solved the issue:How do we fix this?
Comment #16
ruscoe commentedWe're going to be ending support for the 7.x-3.x branch due to the upcoming deprecation of the v2.0 MailChimp API. If you're still seeing this issue with the most recent release, please feel free to reopen.