summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2017-01-31 10:13:46 (GMT)
committerAlex Pott2017-01-31 10:13:57 (GMT)
commit7e5875ce5777f7dadc387f14c9d310c0d0a5fcc9 (patch)
treebf2c05411ae3c12725ca01850c19e481afd6fcad
parent0f1120457ffb0ad50077d61ca1b661aa176cacd9 (diff)
Issue #2509268 by joshi.rohit100, dmsmidt, tim.plunkett, willzyx, SKAUGHT, pfrenssen, left, mgifford, ok_lyndsey, TR, kattekrab, alexpott, bojanz, yched: Inline errors repeated on child elements in module uninstall form
(cherry picked from commit 43f606929599ea23e06665a30040860006b31f49)
-rw-r--r--core/modules/system/src/Form/ModulesUninstallForm.php2
-rw-r--r--core/modules/system/src/Tests/Module/UninstallTest.php5
2 files changed, 6 insertions, 1 deletions
diff --git a/core/modules/system/src/Form/ModulesUninstallForm.php b/core/modules/system/src/Form/ModulesUninstallForm.php
index a06810e..92a15a7 100644
--- a/core/modules/system/src/Form/ModulesUninstallForm.php
+++ b/core/modules/system/src/Form/ModulesUninstallForm.php
@@ -167,7 +167,7 @@ class ModulesUninstallForm extends FormBase {
public function validateForm(array &$form, FormStateInterface $form_state) {
// Form submitted, but no modules selected.
if (!array_filter($form_state->getValue('uninstall'))) {
- $form_state->setErrorByName('uninstall', $this->t('No modules selected.'));
+ $form_state->setErrorByName('', $this->t('No modules selected.'));
$form_state->setRedirect('system.modules_uninstall');
}
}
diff --git a/core/modules/system/src/Tests/Module/UninstallTest.php b/core/modules/system/src/Tests/Module/UninstallTest.php
index 9cecf8f..20e191d 100644
--- a/core/modules/system/src/Tests/Module/UninstallTest.php
+++ b/core/modules/system/src/Tests/Module/UninstallTest.php
@@ -121,6 +121,11 @@ class UninstallTest extends WebTestBase {
$this->drupalGet('admin/modules/uninstall/confirm');
$this->assertUrl('admin/modules/uninstall');
$this->assertTitle(t('Uninstall') . ' | Drupal');
+
+ // Make sure the correct error is shown when no modules are selected.
+ $edit = array();
+ $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall'));
+ $this->assertText(t('No modules selected.'), 'No module is selected to uninstall');
}
/**