Commit 2733a1b1 authored by catch's avatar catch

Issue #1892662 by alberto56, iaha, swentel: Added Don't show 'Import all'...

Issue #1892662 by alberto56, iaha, swentel: Added Don't show 'Import all' button if there is nothing to import.
parent 091834d5
......@@ -25,6 +25,7 @@ function config_admin_sync_form(array &$form, array &$form_state, StorageInterfa
$form['no_changes'] = array(
'#markup' => t('There is no configuration to import.'),
);
$form['actions']['#access'] = FALSE;
return $form;
}
......@@ -80,13 +81,14 @@ function config_admin_import_form($form, &$form_state) {
$source_storage = drupal_container()->get('config.storage.staging');
$target_storage = drupal_container()->get('config.storage');
config_admin_sync_form($form, $form_state, $source_storage, $target_storage);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Import all'),
);
config_admin_sync_form($form, $form_state, $source_storage, $target_storage);
return $form;
}
......
......@@ -47,6 +47,7 @@ function testImport() {
// Verify that the import UI recognises that the staging folder is empty.
$this->drupalGet('admin/config/development/sync');
$this->assertText('There is no configuration to import.');
$this->assertNoFieldById('edit-submit', t('Import all'));
// Create updated configuration object.
$new_site_name = 'Config import test ' . $this->randomString();
......@@ -76,12 +77,14 @@ function testImport() {
$this->drupalGet('admin/config/development/sync');
$this->assertText($name);
$this->assertText($dynamic_name);
$this->assertFieldById('edit-submit', t('Import all'));
// Import and verify that both do not appear anymore.
$this->drupalPost(NULL, array(), t('Import all'));
$this->assertUrl('admin/config/development/sync');
$this->assertNoText($name);
$this->assertNoText($dynamic_name);
$this->assertNoFieldById('edit-submit', t('Import all'));
// Verify that there are no further changes to import.
$this->assertText(t('There is no configuration to import.'));
......
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