Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / contact / src / Controller / ContactController.php
index 35655342f62c6af3df258d3fd25f77fde1d2bfff..6f9568f6d6cacf88cc2cfba932a5ed0281f20c13 100644 (file)
@@ -47,7 +47,8 @@ class ContactController extends ControllerBase {
    *   The contact form to use.
    *
    * @return array
-   *   The form as render array as expected by drupal_render().
+   *   The form as render array as expected by
+   *   \Drupal\Core\Render\RendererInterface::render().
    *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
    *   Exception is thrown when user tries to access non existing default
@@ -64,9 +65,9 @@ class ContactController extends ControllerBase {
       // If there are no forms, do not display the form.
       if (empty($contact_form)) {
         if ($this->currentUser()->hasPermission('administer contact forms')) {
-          drupal_set_message($this->t('The contact form has not been configured. <a href=":add">Add one or more forms</a> .', [
+          $this->messenger()->addError($this->t('The contact form has not been configured. <a href=":add">Add one or more forms</a> .', [
             ':add' => $this->url('contact.form_add'),
-          ]), 'error');
+          ]));
           return [];
         }
         else {
@@ -95,7 +96,8 @@ class ContactController extends ControllerBase {
    *   The account for which a personal contact form should be generated.
    *
    * @return array
-   *   The personal contact form as render array as expected by drupal_render().
+   *   The personal contact form as render array as expected by
+   *   \Drupal\Core\Render\RendererInterface::render().
    *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
    *   Exception is thrown when user tries to access a contact form for a