You are here

function gathercontent_update_7306 in GatherContent 7.3

Set templates to existing mappings.

File

./gathercontent.install, line 367

Code

function gathercontent_update_7306() {
  $mappings = entity_load('gathercontent_mapping');
  $tmp = new GatherContent\Template();
  foreach ($mappings as $mapping) {
    if (empty($mapping->template)) {
      $template = $tmp
        ->getTemplate($mapping->gathercontent_template_id);
      $mapping->template = serialize($template);
      $mapping
        ->save();
    }
  }
}