summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2013-02-18 10:57:05 (GMT)
committercatch2013-02-18 10:57:05 (GMT)
commit2733a1b1ee9c7e4622209029b52bc469b6b9885e (patch)
tree1feb9cd9f52a4ffb0c5cc98673b2e568fb7ad91f
parent091834d5015ca0464fe32f872f23044c3fd90a54 (diff)
Issue #1892662 by alberto56, iaha, swentel: Added Don't show 'Import all' button if there is nothing to import.
-rw-r--r--core/modules/config/config.admin.inc6
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php3
2 files changed, 7 insertions, 2 deletions
diff --git a/core/modules/config/config.admin.inc b/core/modules/config/config.admin.inc
index c15e02a..3813885 100644
--- a/core/modules/config/config.admin.inc
+++ b/core/modules/config/config.admin.inc
@@ -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;
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
index 38641f8..7900b7b 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
@@ -47,6 +47,7 @@ class ConfigImportUITest extends WebTestBase {
// 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 @@ class ConfigImportUITest extends WebTestBase {
$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.'));