You are here

public function AuditFilesMergeFileReferences::submissionHandlerMergeRecordPreConfirm in Audit Files 8.2

Same name and namespace in other branches
  1. 8.3 src/Form/AuditFilesMergeFileReferences.php \Drupal\auditfiles\Form\AuditFilesMergeFileReferences::submissionHandlerMergeRecordPreConfirm()
  2. 8 src/Form/AuditFilesMergeFileReferences.php \Drupal\auditfiles\Form\AuditFilesMergeFileReferences::submissionHandlerMergeRecordPreConfirm()
  3. 4.x src/Form/AuditFilesMergeFileReferences.php \Drupal\auditfiles\Form\AuditFilesMergeFileReferences::submissionHandlerMergeRecordPreConfirm()

Preconfirm form submission.

File

src/Form/AuditFilesMergeFileReferences.php, line 424

Class

AuditFilesMergeFileReferences
Form for merge file references.

Namespace

Drupal\auditfiles\Form

Code

public function submissionHandlerMergeRecordPreConfirm(array &$form, FormStateInterface $form_state) {
  if (!empty($form_state
    ->getValue('files_being_merged'))) {
    foreach ($form_state
      ->getValue('files_being_merged') as $file_id) {
      if (!empty($file_id)) {
        $storage = [
          'files_being_merged' => $form_state
            ->getValue('files_being_merged'),
          'confirm' => TRUE,
          'stage' => 'confirm',
        ];
        $form_state
          ->setStorage($storage);
        $form_state
          ->setRebuild();
      }
    }
  }
}