Commit faa07d7c authored by alexpott's avatar alexpott

Issue #2203779 by ivanstegic, pguillard, Xano, Prashant.c, jhodgdon: Improve...

Issue #2203779 by ivanstegic, pguillard, Xano, Prashant.c, jhodgdon: Improve wording of the configuration import form
parent 51656b32
......@@ -24,6 +24,11 @@ function config_help($route_name, RouteMatchInterface $route_match) {
$output = '';
$output .= '<p>' . t('Import configuration that is placed in your staging directory. All changes, deletions, renames, and additions are listed below.') . '</p>';
return $output;
case 'config.import_full':
$output = '';
$output .= '<p>' . t('After uploading a configuration archive, you will be able to examine the changes and import them.') . '</p>';
return $output;
}
}
......
......@@ -55,13 +55,10 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['description'] = array(
'#markup' => '<p>' . $this->t('Use the upload button below.') . '</p>',
);
$form['import_tarball'] = array(
'#type' => 'file',
'#title' => $this->t('Select your configuration export file'),
'#description' => $this->t('This form will redirect you to the import configuration screen.'),
'#title' => $this->t('Configuration archive'),
'#description' => $this->t('Allowed types: @extensions.', array('@extensions' => 'tar.gz tgz tar.bz2')),
);
$form['submit'] = array(
......@@ -80,7 +77,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
$form_state->setValue('import_tarball', $file_upload->getRealPath());
}
else {
$form_state->setErrorByName('import_tarball', $this->t('The import tarball could not be uploaded.'));
$form_state->setErrorByName('import_tarball', $this->t('The file could not be uploaded.'));
}
}
......@@ -97,7 +94,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$files[] = $file['filename'];
}
$archiver->extractList($files, config_get_config_directory(CONFIG_STAGING_DIRECTORY));
drupal_set_message($this->t('Your configuration files were successfully uploaded, ready for import.'));
drupal_set_message($this->t('Your configuration files were successfully uploaded and are ready for import.'));
$form_state->setRedirect('config.sync');
}
catch (\Exception $e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment