You are here

function _webform_views_options_validate in Webform 7.4

Validate handler for webform_views_options_form().

2 calls to _webform_views_options_validate()
webform_handler_field_submission_data::options_validate in views/webform_handler_field_submission_data.inc
Validate the options form.
webform_handler_relationship_submission_data::options_validate in views/webform_handler_relationship_submission_data.inc
Validate the options form.

File

views/webform.views.inc, line 711
Views hooks implemented for the Webform module.

Code

function _webform_views_options_validate(&$form, &$form_state) {

  // Just store the checked components of the selected type.
  if (empty($form_state['values']['options']['webform_nid'])) {
    form_error($form['webform_nid'], t('Webform NID is required.'));
  }
  else {
    $nid = preg_replace('/^.*?nid:([0-9]+).*?$/', '$1', $form_state['values']['options']['webform_nid']);
    if (!($nid && ($node = node_load($nid)) && !empty($node->webform['components']))) {
      form_error($form['webform_nid'], t('The specified node is not valid.'));
    }
  }
}