public function ActionForm::ajaxValidate in Filebrowser 3.x
Same name and namespace in other branches
- 8.2 src/Form/ActionForm.php \Drupal\filebrowser\Form\ActionForm::ajaxValidate()
File
- src/
Form/ ActionForm.php, line 137
Class
- ActionForm
- Class ActionForm.
Namespace
Drupal\filebrowser\FormCode
public function ajaxValidate(&$form, FormStateInterface $form_state) {
// \Drupal::logger('filebrowser')->notice('AJAX 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)) {
//set the error to the submit function:
// \Drupal::logger('filebrowser')->notice('Error no items selected');
$this->error = true;
}
}