I'm attempting to add a lot of terms (~200) to a vocabulary, but I can't find any import modules that are updated for Drupal 8, and it seems the functions for doing this in Drupal 7 don't exist in Drupal 8. So, can anyone point me in the right direction for doing this?
I attempted to do it with entity_create
, as suggested in the comments, with this code:
$term_create = entity_create('taxonomy_term', array('name' => 'test', 'vocabulary_name' => 'client'));
but I got this error:
Drupal\Core\Entity\EntityStorageException: Missing bundle for entity type taxonomy_term in Drupal\Core\Entity\FieldableEntityStorageControllerBase->create() (line 65 of core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php).
Any ideas?
entity_create()
$term_create = entity_create('taxonomy_term', array('name' => 'test', 'vocabulary_name' => 'client'));
, but I got the errorDrupal\Core\Entity\EntityStorageException: Missing bundle for entity type taxonomy_term in Drupal\Core\Entity\FieldableEntityStorageControllerBase->create() (line 65 of core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php).
-- Any ideas?vid
in place ofvocabulary_name
. Looks like the column is stillvid
intaxonomy_term_data
, but it's the vocab name instead of id now