// Prevent this page from showing when the module list is empty.
if (empty($this->modules)) {
- drupal_set_message($this->t('The selected modules could not be uninstalled, either due to a website problem or due to the uninstall confirmation form timing out. Please try again.'), 'error');
+ $this->messenger()->addError($this->t('The selected modules could not be uninstalled, either due to a website problem or due to the uninstall confirmation form timing out. Please try again.'));
return $this->redirect('system.modules_uninstall');
}
// Uninstall the modules.
$this->moduleInstaller->uninstall($this->modules);
- drupal_set_message($this->t('The selected modules have been uninstalled.'));
+ $this->messenger()->addStatus($this->t('The selected modules have been uninstalled.'));
$form_state->setRedirectUrl($this->getCancelUrl());
}