function contact_config_import_change

Implements MODULE_config_import_change().

File

drupal/core/modules/contact/contact.module, line 179
Enables the use of personal and site-wide contact forms.

Code

function contact_config_import_change($name, $new_config, $old_config) {
  if (strpos($name, 'contact.category.') !== 0) {
    return FALSE;
  }
  list(, , $id) = explode('.', $name);
  $category = entity_load('contact_category', $id);
  $category->original = clone $category;
  foreach ($old_config
    ->get() as $property => $value) {
    $category->original->{$property} = $value;
  }
  foreach ($new_config
    ->get() as $property => $value) {
    $category->{$property} = $value;
  }
  $category
    ->save();
  return TRUE;
}