Users can submit the Webforms without entering a value for the email address when the component setting is set to required.

Webform Mailchimp component set to 'required':
Webform Mailchimp setting on required

No red dot on the input field, and all values are allowed to be submitted:
Webform example

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JordanMagnuson’s picture

Issue summary: View changes

Confirmed for me as well.

JordanMagnuson’s picture

Requires simple change in the _webform_render_mailchimp() function in webform_mailchimp.inc:

This line:
'#required' => $component['mandatory']

Needs to be changed to:
'#required' => $component['required'],

JordanMagnuson’s picture

Status: Active » Needs review
nidble’s picture

Following other components conventions, I think is better to remove the 16th row from webform_mailchimp.module, just inside hook_webform_component_info() implementation:

  $components = array();

  $components['mailchimp'] = array(
    'label' => t('Mailchimp'),
    'description' => t('Sign up to a newsletter.'),
    'features' => array(
      'csv' => TRUE,
      'email' => FALSE,
      'email_address' => TRUE,
      'email_name' => FALSE,
      'conditional' => FALSE,
      'group' => FALSE,
      'attachment' => FALSE,
    ),
    'file' => 'webform_mailchimp.inc',
  );

  return $components;
}

This fix is required for both versions 6/7 of the module.

jonathanwestman’s picture

Created a patch using the code from above

kopeboy’s picture

Status: Needs review » Reviewed & tested by the community

That fixes it, thanks.

  • ed6b0aa committed on 7.x-2.x
    Issue #2124009 by jonathanwestman, silkogelman: Required setting not...
blackdog’s picture

Status: Reviewed & tested by the community » Fixed

comitted, thanks! Is this needed for 7.x-4.x too?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.