You are here

public function ActionForm::validateForm in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x src/Form/ActionForm.php \Drupal\filebrowser\Form\ActionForm::validateForm()

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/ActionForm.php, line 126

Class

ActionForm
Class ActionForm.

Namespace

Drupal\filebrowser\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {

  // \Drupal::logger('filebrowser')->notice('NORMAL ACTION FORM VALIDATE');
  // All submit button needs selected items. If noting selected generate
  // form_error
  $element = $form_state
    ->getTriggeringElement();
  $this->fids = $this
    ->getFids($form, $form_state);
  if (empty($this->fids)) {
    $form_state
      ->setError($element, $this
      ->t('You didn\'t select any item'));
  }
}