function ReviewForm::submitForm

Same name in other branches
  1. 8.9.x core/modules/migrate_drupal_ui/src/Form/ReviewForm.php \Drupal\migrate_drupal_ui\Form\ReviewForm::submitForm()
  2. 10 core/modules/migrate_drupal_ui/src/Form/ReviewForm.php \Drupal\migrate_drupal_ui\Form\ReviewForm::submitForm()
  3. 11.x core/modules/migrate_drupal_ui/src/Form/ReviewForm.php \Drupal\migrate_drupal_ui\Form\ReviewForm::submitForm()

Overrides FormInterface::submitForm

File

core/modules/migrate_drupal_ui/src/Form/ReviewForm.php, line 242

Class

ReviewForm
Migrate Upgrade review form.

Namespace

Drupal\migrate_drupal_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $config['source_base_path'] = $this->store
        ->get('source_base_path');
    $config['source_private_file_path'] = $this->store
        ->get('source_private_file_path');
    $batch_builder = (new BatchBuilder())->setTitle($this->t('Running upgrade'))
        ->setProgressMessage('')
        ->addOperation([
        MigrateUpgradeImportBatch::class,
        'run',
    ], [
        array_keys($this->migrations),
        $config,
    ])
        ->setFinishCallback([
        MigrateUpgradeImportBatch::class,
        'finished',
    ]);
    batch_set($batch_builder->toArray());
    $form_state->setRedirect('<front>');
    $this->store
        ->set('step', 'overview');
    $this->state
        ->set('migrate_drupal_ui.performed', REQUEST_TIME);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.