public function submitForm(array &
$form, FormStateInterface
$form_state) { // If this form has not yet been confirmed, store the values and rebuild.
if (!
$this->data
) { $form_state->
setRebuild();
$this->data =
$form_state->
getValues();
return;
} /** @var \Drupal\Core\Config\ConfigImporter $config_importer */
$config_importer =
$form_state->
get('config_importer'
);
if ($config_importer->
alreadyImporting()) { $this->
messenger()->
addError($this->
t('Another request may be importing configuration already.'
));
} else { try { $sync_steps =
$config_importer->
initialize();
$batch_builder =
(new BatchBuilder()) ->
setTitle($this->
t('Importing configuration'
)) ->
setFinishCallback([ConfigImporterBatch::
class, 'finish'
]) ->
setInitMessage($this->
t('Starting configuration import.'
)) ->
setProgressMessage($this->
t('Completed @current step of @total.'
)) ->
setErrorMessage($this->
t('Configuration import has encountered an error.'
));