You are here

function filefield_paths_form_submit in File (Field) Paths 8

Same name and namespace in other branches
  1. 5 filefield_paths.module \filefield_paths_form_submit()
  2. 6 filefield_paths.module \filefield_paths_form_submit()
  3. 7 filefield_paths.module \filefield_paths_form_submit()

Submit callback for File (Field) Paths settings form.

Parameters

array $form: TODO.

FormStateInterface $form_state: TODO.

1 string reference to 'filefield_paths_form_submit'
filefield_paths_form_field_config_edit_form_alter in ./filefield_paths.module
Implements hook_form_FORM_ID_alter().

File

./filefield_paths.module, line 232
Contains core functions for the File (Field) Paths module.

Code

function filefield_paths_form_submit($form, FormStateInterface $form_state) {
  $settings = $form_state
    ->getValue('third_party_settings')['filefield_paths'];

  // Retroactive updates.
  if ($settings['enabled'] && $settings['retroactive_update']) {
    if (filefield_paths_batch_update($form_state
      ->getFormObject()
      ->getEntity())) {
      $response = batch_process($form_state
        ->getRedirect());
      if ($response instanceof Response) {
        $response
          ->send();
      }
    }
  }
}