Unverified Commit 8455641d authored by alexpott's avatar alexpott

Issue #2981225 by maxocub, RumyanaRuseva, mpp: Migration fails to create...

Issue #2981225 by maxocub, RumyanaRuseva, mpp: Migration fails to create instance when non-bundleable entity type exists

(cherry picked from commit 68c7b00c)
parent 9f4ca29c
......@@ -109,6 +109,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
$derivative_key = $entity_type . '__' . $bundle;
$derivative = $base_plugin_definition;
$entity_type_definition = $this->entityTypeManager->getDefinition($entity_type);
// Set the migration label.
$derivative['label'] = $this->t('@label (@derivative)', [
......@@ -118,10 +119,11 @@ public function getDerivativeDefinitions($base_plugin_definition) {
// Set the source plugin.
$derivative['source']['plugin'] = 'content_entity' . PluginBase::DERIVATIVE_SEPARATOR . $entity_type;
$derivative['source']['bundle'] = $bundle;
if ($entity_type_definition->hasKey('bundle')) {
$derivative['source']['bundle'] = $bundle;
}
// Set the process pipeline.
$entity_type_definition = $this->entityTypeManager->getDefinition($entity_type);
$id_key = $entity_type_definition->getKey('id');
$derivative['process'][$id_key] = $id_key;
if ($entity_type_definition->isRevisionable()) {
......@@ -135,7 +137,9 @@ public function getDerivativeDefinitions($base_plugin_definition) {
// Set the destination plugin.
$derivative['destination']['plugin'] = 'entity' . PluginBase::DERIVATIVE_SEPARATOR . $entity_type;
$derivative['destination']['default_bundle'] = $bundle;
if ($entity_type_definition->hasKey('bundle')) {
$derivative['destination']['default_bundle'] = $bundle;
}
if ($entity_type_definition->isTranslatable()) {
$derivative['destination']['translations'] = TRUE;
}
......
......@@ -4492,6 +4492,15 @@
'data' => 'a:6:{s:5:"label";s:11:"Reference 2";s:6:"widget";a:4:{s:4:"type";s:14:"options_select";s:6:"weight";s:2:"21";s:8:"settings";a:0:{}s:6:"module";s:7:"options";}s:8:"settings";a:1:{s:18:"user_register_form";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:21:"entityreference_label";s:8:"settings";a:2:{s:4:"link";b:0;s:13:"bypass_access";b:0;}s:6:"module";s:15:"entityreference";s:6:"weight";i:21;}}s:8:"required";b:0;s:11:"description";s:0:"";}',
'deleted' => '0',
))
->values(array(
'id' => '66',
'field_id' => '38',
'field_name' => 'field_reference',
'entity_type' => 'user',
'bundle' => 'user',
'data' => 'a:7:{s:5:"label";s:9:"Reference";s:6:"widget";a:5:{s:6:"weight";s:2:"11";s:4:"type";s:14:"options_select";s:6:"module";s:7:"options";s:6:"active";i:1;s:8:"settings";a:0:{}}s:8:"settings";a:2:{s:18:"user_register_form";i:0;s:23:"entity_translation_sync";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:21:"entityreference_label";s:8:"settings";a:2:{s:4:"link";b:0;s:13:"bypass_access";b:0;}s:6:"module";s:15:"entityreference";s:6:"weight";i:9;}}s:8:"required";i:0;s:11:"description";s:0:"";s:13:"default_value";N;}',
'deleted' => '0',
))
->execute();
$connection->schema()->createTable('field_data_body', array(
......@@ -66,8 +66,8 @@ protected function getEntityCounts() {
'configurable_language' => 4,
'contact_form' => 3,
'editor' => 2,
'field_config' => 66,
'field_storage_config' => 49,
'field_config' => 67,
'field_storage_config' => 50,
'file' => 3,
'filter_format' => 7,
'image_style' => 6,
......
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