X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fconfig%2Fsrc%2FForm%2FConfigImportForm.php;h=28852f24eaa93cf78e3233931bc5f1272be8e881;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=0c3def8619d6ef814979da2dbb693555e3768373;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/config/src/Form/ConfigImportForm.php b/web/core/modules/config/src/Form/ConfigImportForm.php index 0c3def861..28852f24e 100644 --- a/web/core/modules/config/src/Form/ConfigImportForm.php +++ b/web/core/modules/config/src/Form/ConfigImportForm.php @@ -10,6 +10,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** * Defines the configuration import form. + * + * @internal */ class ConfigImportForm extends FormBase { @@ -53,7 +55,7 @@ class ConfigImportForm extends FormBase { $directory = config_get_config_directory(CONFIG_SYNC_DIRECTORY); $directory_is_writable = is_writable($directory); if (!$directory_is_writable) { - drupal_set_message($this->t('The directory %directory is not writable.', ['%directory' => $directory]), 'error'); + $this->messenger()->addError($this->t('The directory %directory is not writable.', ['%directory' => $directory])); } $form['import_tarball'] = [ '#type' => 'file', @@ -98,11 +100,11 @@ class ConfigImportForm extends FormBase { $files[] = $file['filename']; } $archiver->extractList($files, config_get_config_directory(CONFIG_SYNC_DIRECTORY)); - drupal_set_message($this->t('Your configuration files were successfully uploaded and are ready for import.')); + $this->messenger()->addStatus($this->t('Your configuration files were successfully uploaded and are ready for import.')); $form_state->setRedirect('config.sync'); } catch (\Exception $e) { - drupal_set_message($this->t('Could not extract the contents of the tar file. The error message is @message', ['@message' => $e->getMessage()]), 'error'); + $this->messenger()->addError($this->t('Could not extract the contents of the tar file. The error message is @message', ['@message' => $e->getMessage()])); } drupal_unlink($path); }