You are here

function _webform_antibot_form_validate in Webform 6.x

Same name and namespace in other branches
  1. 8.5 third_party_settings/webform.antibot.inc \_webform_antibot_form_validate()

Validate callback; Checks if antibot is disabled and remove it from the third party settings values.

1 string reference to '_webform_antibot_form_validate'
_webform_antibot_form in third_party_settings/webform.antibot.inc
Alter webform third party settings webforms to include Antibot configuration.

File

third_party_settings/webform.antibot.inc, line 78
Integrates third party settings on the Antibot module's behalf.

Code

function _webform_antibot_form_validate(&$form, FormStateInterface $form_state) {
  $third_party_settings = $form_state
    ->getValue('third_party_settings');
  if ($form_state
    ->get('antibot_disabled') || empty($third_party_settings['antibot']['antibot'])) {
    unset($third_party_settings['antibot']['antibot']);
  }
  $form_state
    ->setValue('third_party_settings', $third_party_settings);
}