Commit 7e5875ce authored by alexpott's avatar alexpott

Issue #2509268 by joshi.rohit100, dmsmidt, tim.plunkett, willzyx, SKAUGHT,...

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 43f60692)
parent 0f112045
......@@ -167,7 +167,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
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');
}
}
......
......@@ -121,6 +121,11 @@ function testUninstallPage() {
$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');
}
/**
......
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