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.
When creating a signup form, fields that are marked as required in the mailchimp form are not marked as required in the Drupal form, except for the e-mail field, and do not provide HTML5 validation.
Radio buttons fields and interest groups show with a * (star) next to it, as if they were required, when they are not. Although the fields are marked with a star, the module lets you submit the form without filling them.
Comments
Comment #2
mrupsidown CreditAttribution: mrupsidown commentedThe fact that it adds the * (star) next to the field label seems to be a bug in the Bootstrap theme in the form-element-label.html.twig file in the if condition:
So please disregard this part of the issue.
The rest is still valid: A field marked as "required" in the Mailchimp form designer is not treated as required in the Drupal form and HTML5 validation is not available.
Comment #3
mrupsidown CreditAttribution: mrupsidown commentedComment #4
asrobComment #5
helmo CreditAttribution: helmo at Initfour websolutions commentedl also noticed this in 7.x-4.7 but fields like firstname and last name also work. Just not an extra field we have.
After some digging I discovered that of the two lists we offer to subscribe to on the form one had the field as required, the other did not.
The mergevars for various lists get merged in the code below. so only data from the last list that has this mergevar is used.
An option could be to add an extra if in here to check the 'required' value.
Comment #6
samuel.mortenson@helmo I was just looking into
mailchimp_insert_drupal_form_tag()
and it looks like we are respecting the required status of merge vars, is there another place I should be looking to see this bug?Comment #7
gcb