You are here

public function ExifSettingsForm::validateForm in Exif 8

Same name and namespace in other branches
  1. 8.2 src/Controller/ExifSettingsForm.php \Drupal\exif\Controller\ExifSettingsForm::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/Controller/ExifSettingsForm.php, line 227

Class

ExifSettingsForm
Manage Settings forms.

Namespace

Drupal\exif\Controller

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('extraction_solution') == 'simple_exiftool' && !is_executable($form_state
    ->getValue('exiftool_location'))) {
    $form_state
      ->setErrorByName('exiftool_location', $this
      ->t('The location provided for exiftool is not correct. Please ensure the exiftool location exists and is executable.'));
  }
  parent::validateForm($form, $form_state);
}