You are here

public function GridActionForm::ajaxValidate in Filebrowser 8.2

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

File

src/Form/GridActionForm.php, line 190

Class

GridActionForm
Class GridActionForm.

Namespace

Drupal\filebrowser\Form

Code

public function ajaxValidate(&$form, FormStateInterface $form_state) {

  // All submit button needs selected items. If noting selected generate form_error
  $this->fids = $this
    ->getFids($form, $form_state);
  if (empty($this->fids)) {

    //set the error to the submit function:
    \Drupal::logger('filebrowser')
      ->notice('Error no items selected');
    $this->error = true;
  }
}