You are here

function domain_entity_update_7000 in Domain Access Entity 7

Implements hook_update_N().

For user that used this module before he has a stable version.

Migrate to DOMAIN_ALL and DOMAIN_ACTIVE constants.

File

./domain_entity.install, line 43
Domain Access Entity install function

Code

function domain_entity_update_7000() {
  $allowed_entity = variable_get('domain_entity_allowed_entity_types', array());
  foreach ($allowed_entity as $entity_name => $bundle) {
    foreach ($bundle as $bundle_name => $widget) {
      $default_value = reset($widget);
      if (reset($default_value) == 'all') {
        $allowed_entity[$entity_name][$bundle_name][key($widget)] = array(
          DOMAIN_ALL => DOMAIN_ALL,
        );
      }
      if (reset($default_value) == 'current_domain') {
        $allowed_entity[$entity_name][$bundle_name][key($widget)] = array(
          DOMAIN_ACTIVE => DOMAIN_ACTIVE,
        );
      }
    }
  }
  variable_set('domain_entity_allowed_entity_types', $allowed_entity);
}