comparison core/modules/contact/src/Controller/ContactController.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children af1871eacc83
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
63 ->getStorage('contact_form') 63 ->getStorage('contact_form')
64 ->load($config->get('default_form')); 64 ->load($config->get('default_form'));
65 // If there are no forms, do not display the form. 65 // If there are no forms, do not display the form.
66 if (empty($contact_form)) { 66 if (empty($contact_form)) {
67 if ($this->currentUser()->hasPermission('administer contact forms')) { 67 if ($this->currentUser()->hasPermission('administer contact forms')) {
68 drupal_set_message($this->t('The contact form has not been configured. <a href=":add">Add one or more forms</a> .', [ 68 $this->messenger()->addError($this->t('The contact form has not been configured. <a href=":add">Add one or more forms</a> .', [
69 ':add' => $this->url('contact.form_add'), 69 ':add' => $this->url('contact.form_add'),
70 ]), 'error'); 70 ]));
71 return []; 71 return [];
72 } 72 }
73 else { 73 else {
74 throw new NotFoundHttpException(); 74 throw new NotFoundHttpException();
75 } 75 }