Skip to content
Snippets Groups Projects
Commit c1a3ac6d authored by Nejc Koporec's avatar Nejc Koporec
Browse files

Auto-create new tags terms

parent f3734740
Branches feat/add-new-fields-to-space-entity
No related tags found
No related merge requests found
......@@ -123,7 +123,13 @@ function nodehive_core_update_10001() {
->setRevisionable(TRUE)
->setSetting('target_type', 'taxonomy_term')
->setSetting('handler', 'default')
->setSetting('handler_settings', ['target_bundles' => ['nodehive_space_tags' => 'nodehive_space_tags']])
->setSetting('handler_settings', [
'target_bundles' => [
'nodehive_space_tags' => 'nodehive_space_tags'
],
'auto_create' => TRUE,
'auto_create_bundle' => 'nodehive_space_tags',
])
->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED)
->setTranslatable(TRUE)
->setDisplayOptions('form', [
......
......@@ -313,7 +313,13 @@ class Space extends ContentEntityBase implements SpaceInterface {
->setRevisionable(TRUE)
->setSetting('target_type', 'taxonomy_term')
->setSetting('handler', 'default')
->setSetting('handler_settings', ['target_bundles' => ['nodehive_space_tags' => 'nodehive_space_tags']])
->setSetting('handler_settings', [
'target_bundles' => [
'nodehive_space_tags' => 'nodehive_space_tags'
],
'auto_create' => TRUE,
'auto_create_bundle' => 'nodehive_space_tags',
])
->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED)
->setTranslatable(TRUE)
->setDisplayOptions('form', [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment