You are here

public function NodeExpireAdminSettings::validateForm in Node expire 8

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

src/Form/NodeExpireAdminSettings.php, line 119
Contains \Drupal\node_expire\Form\NodeExpireAdminSettings.

Class

NodeExpireAdminSettings

Namespace

Drupal\node_expire\Form

Code

public function validateForm(array &$form, \Drupal\Core\Form\FormStateInterface &$form_state) {
  if ($form_state
    ->getValue([
    'node_expire_date_entry_elements',
  ]) == 1 && $form_state
    ->getValue([
    'node_expire_handle_content_expiry',
  ]) != 0 && !\Drupal::moduleHandler()
    ->moduleExists('date_popup')) {
    $form_state
      ->setErrorByName('date_entry_elements', t('To use "Date popups" option Date module should be installed with Date Popup enabled.'));
  }

  // End of node_expire_admin_settings_validate().
}