This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/core/modules/contact/contact.post_update.php
2017-04-13 15:53:35 +01:00

23 lines
495 B
PHP

<?php
/**
* @file
* Post update functions for Contact.
*/
use Drupal\contact\Entity\ContactForm;
/**
* Initialize 'message' and 'redirect' field values to 'contact_form' entities.
*/
function contact_post_update_add_message_redirect_field_to_contact_form() {
/** @var \Drupal\contact\ContactFormInterface $contact */
foreach (ContactForm::loadMultiple() as $contact) {
$contact
->setMessage('Your message has been sent.')
->setRedirectPath('')
->save();
}
}