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
parent
1fbdcc7a10
commit
43f6069295
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue