Hello everyone,
Confirming this post I have spot three issues for Webform Simplenews Component module.
1) The description text isn't show in the form.
2) The newsletter_email field cannot be set to unique (like the webform email field).
3) Webform Validation module doesn't identify newsletter_email component and no validation rules can be applied for this component.
The first issue can be easily fixed, making the following additions in the webform.simplenews.inc file:
- in the function _webform_defaults_newsletter_email()
function _webform_defaults_newsletter_email() {
return array(
'name' => '',
'form_key' => NULL,
'pid' => 0,
'weight' => 0,
'value' => '',
'user_email' => 1,
'mandatory' => 0,
'email' => 1,
'extra' => array(
'width' => '',
+ 'description' => '',
'attributes' => array(),
'news_vid' => 0,
'action' => '',
),
);
}- in the function _webform_render_newsletter_email($component, $value = NULL)
function _webform_render_newsletter_email($component, $value = NULL) {
...
$element = array(
'#title' => htmlspecialchars($component['name'], ENT_QUOTES),
'#required' => $component['mandatory'],
'#weight' => $component['weight'],
+ '#description' => $filter ? _webform_filter_descriptions($component['extra']['description'], $node) : $component['extra']['description'],
'#prefix' => '<div class="webform-component-'. $component['type'] .'" id="webform-component-'. $component['form_key'] .'">',
'#suffix' => '</div>',
'#webform_component' => $component,
'#theme' => 'webform_newsletter_email',
'#element_validate' => array('_webform_validate_newsletter_email'),
);
...
}I tried to fix the second one (unique) by making similar additions but it seems that the function which controls unique validation cannot be loaded from this file.
I have no idea with regards to the third issue, but if it is solved it is possible to add unique rule for newsletter_email components using Webform Validation module.
Of course you can always use the Webform PHP module in order to add rules for newsletter_email components (already successfully tested).
Any ideas would help.
Thank you for your time.
Best regards
John