You are here

public function ImageAPIOptimizePipelineEditForm::processorValidate in Image Optimize (or ImageAPI Optimize) 8.2

Same name and namespace in other branches
  1. 8.3 src/Form/ImageAPIOptimizePipelineEditForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizePipelineEditForm::processorValidate()
  2. 4.x src/Form/ImageAPIOptimizePipelineEditForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizePipelineEditForm::processorValidate()

Validate handler for image optimize processor.

File

src/Form/ImageAPIOptimizePipelineEditForm.php, line 185

Class

ImageAPIOptimizePipelineEditForm
Controller for image optimize pipeline edit form.

Namespace

Drupal\imageapi_optimize\Form

Code

public function processorValidate($form, FormStateInterface $form_state) {
  if (!$form_state
    ->getValue('new')) {
    $form_state
      ->setErrorByName('new', $this
      ->t('Select a processor to add.'));
  }
}