Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / src / CronController.php
index ec1156955f3b511474462bc73538454c77920ea9..2626bf3a05915858341cc669e6a0c546951ea70e 100644 (file)
@@ -36,7 +36,6 @@ class CronController extends ControllerBase {
     return new static($container->get('cron'));
   }
 
-
   /**
    * Run Cron once.
    *
@@ -58,10 +57,10 @@ class CronController extends ControllerBase {
    */
   public function runManually() {
     if ($this->cron->run()) {
-      drupal_set_message($this->t('Cron ran successfully.'));
+      $this->messenger()->addStatus($this->t('Cron ran successfully.'));
     }
     else {
-      drupal_set_message($this->t('Cron run failed.'), 'error');
+      $this->messenger()->addError($this->t('Cron run failed.'));
     }
 
     return $this->redirect('system.status');