Security update to Drupal 8.4.6
[yaffs-website] / web / core / modules / contact / contact.post_update.php
1 <?php
2
3 /**
4  * @file
5  * Post update functions for Contact.
6  */
7
8 use Drupal\contact\Entity\ContactForm;
9
10 /**
11  * Initialize 'message' and 'redirect' field values to 'contact_form' entities.
12  */
13 function contact_post_update_add_message_redirect_field_to_contact_form() {
14   /** @var \Drupal\contact\ContactFormInterface $contact */
15   foreach (ContactForm::loadMultiple() as $contact) {
16     $contact
17       ->setMessage('Your message has been sent.')
18       ->setRedirectPath('')
19       ->save();
20   }
21 }