You are here

function uuid_vocabulary_features_rebuild in UUID Features Integration 6

Implementation of hook_features_rebuild(). Rebuilds nodes based on UUID from code defaults.

1 call to uuid_vocabulary_features_rebuild()
uuid_vocabulary_features_revert in includes/uuid_vocabulary.features.inc
Implementation of hook_features_revert().

File

includes/uuid_vocabulary.features.inc, line 91
Features hooks for the uuid_vocabulary features component.

Code

function uuid_vocabulary_features_rebuild($module) {
  $vocabs = module_invoke($module, 'uuid_features_default_vocabularies');
  if (!empty($vocabs)) {
    foreach ($vocabs as $data) {
      $existing = db_result(db_query('SELECT vid FROM {uuid_vocabulary} WHERE uuid = "%s"', $data['uuid']));
      if (!empty($existing)) {
        $data['vid'] = $existing;
      }
      taxonomy_save_vocabulary($data);

      // TODO: remove when http://drupal.org/node/860442 is resolved.
      uuid_set_uuid('vocabulary', 'vid', $data['vid'], $data['uuid']);
    }
  }
}