You are here

public function AuditFilesMergeFileReferences::submissionHandlerMergeRecordPreConfirm in Audit Files 8

Same name and namespace in other branches
  1. 8.3 src/Form/AuditFilesMergeFileReferences.php \Drupal\auditfiles\Form\AuditFilesMergeFileReferences::submissionHandlerMergeRecordPreConfirm()
  2. 8.2 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 332

Class

AuditFilesMergeFileReferences

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();
      }
    }
  }
}