diff -u b/sources/tmgmt_config/src/ConfigSourcePluginUi.php b/sources/tmgmt_config/src/ConfigSourcePluginUi.php --- b/sources/tmgmt_config/src/ConfigSourcePluginUi.php +++ b/sources/tmgmt_config/src/ConfigSourcePluginUi.php @@ -141,7 +141,7 @@ 'id' => $entity->id(), // If the entity type is FieldConfig, we list the field of the fieldable // entity type which doesn't have a link. - 'title' => $entity->getEntityTypeId() == 'field_config' ? $label : $entity->link($label), + 'title' => $entity->url('edit-form') ? $entity->link($label) : $label, ); // Load entity translation specific data. @@ -297,6 +297,7 @@ $item_id = $definition['id']; $items[$item_id]['label'] = $definition['title'];; $items[$item_id]['langcode'] = \Drupal::config($definition['names'][0])->get('langcode') ?: 'en'; + $items[$item_id]['type'] = $type; } } else { @@ -308,11 +309,15 @@ $item_id = $entity->getConfigDependencyName(); $items[$item_id]['label'] = $entity->label(); $items[$item_id]['langcode'] = $entity->language()->getId(); - } - // The type cannot be field_config, should be the id of the - // fieldable entity type. - if ($type == 'field_config') { - $type = $entities[reset($entity_ids)]->get('entity_type') . '_fields'; + + // The type cannot be field_config, should be the id of the + // fieldable entity type. + if ($type == 'field_config') { + $items[$item_id]['type'] = $entity->get('entity_type') . '_fields'; + } + else { + $items[$item_id]['type'] = $type; + } } } $source_lang_registry = array(); @@ -327,7 +332,7 @@ // Create new job. $job = tmgmt_job_create($source_lang, LanguageInterface::LANGCODE_NOT_SPECIFIED, \Drupal::currentUser()->id()); // Add initial job item. - $job->addItem('config', $type, $id); + $job->addItem('config', $extra['type'], $id); // Add job identifier into registry $source_lang_registry[$source_lang] = $job->id(); // Add newly created job into jobs queue. @@ -336,7 +341,7 @@ // We have a job for given source lang, so just add new job item for the // existing job. else { - $jobs[$source_lang_registry[$source_lang]]->addItem('config', $type, $id); + $jobs[$source_lang_registry[$source_lang]]->addItem('config', $extra['type'], $id); } } catch (TMGMTException $e) { watchdog_exception('tmgmt', $e); diff -u b/sources/tmgmt_config/src/Tests/ConfigSourceListTest.php b/sources/tmgmt_config/src/Tests/ConfigSourceListTest.php --- b/sources/tmgmt_config/src/Tests/ConfigSourceListTest.php +++ b/sources/tmgmt_config/src/Tests/ConfigSourceListTest.php @@ -330,6 +330,9 @@ $this->assertEqual(count($this->xpath('//tbody/tr')), 1); } + /** + * Test for field configuration translation from source list. + */ function testFieldConfigList() { $this->drupalGet('admin/tmgmt/sources/config/field_config'); @@ -340,7 +343,8 @@ // Make sure that we're back on the originally defined destination URL. $this->assertUrl('admin/tmgmt/sources/config/field_config'); - + $this->assertText(t('Test translation created.')); + $this->assertText(t('The translation of Body to German is finished and can now be reviewed.')); } }