Commit 4497608d authored by catch's avatar catch

Issue #2618804 by webflo: Migrate required setting from vocabulary to field

parent a3bbaae2
......@@ -34079,7 +34079,7 @@
'relations' => '1',
'hierarchy' => '0',
'multiple' => '0',
'required' => '0',
'required' => '1',
'tags' => '0',
'module' => 'taxonomy',
'weight' => '0',
......
......@@ -23,6 +23,7 @@ process:
'settings/handler': 'constants/selection_handler'
'settings/handler_settings/target_bundles/0': '@field_name'
'settings/handler_settings/auto_create': 'constants/auto_create'
required: required
destination:
plugin: entity:field_config
migration_dependencies:
......
......@@ -40,12 +40,14 @@ public function testVocabularyFieldInstance() {
$field = FieldConfig::load($field_id);
$this->assertIdentical($field_id, $field->id(), 'Field instance exists on article bundle.');
$this->assertIdentical('Tags', $field->label());
$this->assertTrue($field->isRequired(), 'Field is required');
// Test the page bundle as well.
$field_id = 'node.page.tags';
$field = FieldConfig::load($field_id);
$this->assertIdentical($field_id, $field->id(), 'Field instance exists on page bundle.');
$this->assertIdentical('Tags', $field->label());
$this->assertTrue($field->isRequired(), 'Field is required');
$settings = $field->getSettings();
$this->assertIdentical('default:taxonomy_term', $settings['handler'], 'The handler plugin ID is correct.');
......@@ -53,6 +55,11 @@ public function testVocabularyFieldInstance() {
$this->assertIdentical(TRUE, $settings['handler_settings']['auto_create'], 'The "auto_create" setting is correct.');
$this->assertIdentical(array('node', 'article', 'tags'), Migration::load('d6_vocabulary_field_instance')->getIdMap()->lookupDestinationID(array(4, 'article')));
// Test the the field vocabulary_1_i_0_
$field_id = 'node.story.vocabulary_1_i_0_';
$field = FieldConfig::load($field_id);
$this->assertFalse($field->isRequired(), 'Field is not required');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment