Mercurial > hg > isophonics-drupal-site
annotate core/modules/contact/contact.post_update.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 /** |
Chris@0 | 4 * @file |
Chris@0 | 5 * Post update functions for Contact. |
Chris@0 | 6 */ |
Chris@0 | 7 |
Chris@0 | 8 use Drupal\contact\Entity\ContactForm; |
Chris@0 | 9 |
Chris@0 | 10 /** |
Chris@0 | 11 * Initialize 'message' and 'redirect' field values to 'contact_form' entities. |
Chris@0 | 12 */ |
Chris@0 | 13 function contact_post_update_add_message_redirect_field_to_contact_form() { |
Chris@0 | 14 /** @var \Drupal\contact\ContactFormInterface $contact */ |
Chris@0 | 15 foreach (ContactForm::loadMultiple() as $contact) { |
Chris@0 | 16 $contact |
Chris@0 | 17 ->setMessage('Your message has been sent.') |
Chris@0 | 18 ->setRedirectPath('') |
Chris@0 | 19 ->save(); |
Chris@0 | 20 } |
Chris@0 | 21 } |