For import and export, it's more useful to have the vocab machine name available as entity metadata, rather than the vid.

AFAICT this isn't available directly as a property:

  $term = taxonomy_term_load(1);
  $wrapper = entity_metadata_wrapper('taxonomy_term', $term);
  dsm($wrapper->info());
  // Gets a vocabulary object.
  $value = $wrapper->vocabulary->value();
  dsm($value, 'value');
  // Gets a vocab vid.
  $value = $wrapper->vocabulary->raw();
  dsm($value, 'raw');

Comments

joachim’s picture

Category: feature » bug

I'm changing this to a bug, as it seems to me that module should be able to expect to do this to any entity:

$bundle_key = $info['entity keys']['bundle'];
$metadata['properties'][$bundle_key]['label']

which fails on terms, because the 'bundle' on terms is the 'vocabulary_machine_name' property.