Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / src / Form / CronForm.php
index 228dc0b4a4b90519423fbda9a8b1806cc3aa2345..a585aa57cb7c156bbb65cf0460848735b67b462b 100644 (file)
@@ -155,7 +155,7 @@ class CronForm extends FormBase {
     $this->config('system.cron')
       ->set('logging', $form_state->getValue('logging'))
       ->save();
-    drupal_set_message(t('The configuration options have been saved.'));
+    $this->messenger()->addStatus(t('The configuration options have been saved.'));
   }
 
   /**
@@ -163,10 +163,10 @@ class CronForm extends FormBase {
    */
   public function runCron(array &$form, FormStateInterface $form_state) {
     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.'));
     }
   }