view 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
line wrap: on
line source
<?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();
  }
}