reverted: --- b/core/modules/taxonomy/src/Plugin/migrate/source/d6/TaxonomyVocabularyTranslation.php +++ /dev/null @@ -1,71 +0,0 @@ -select('vocabulary', 'v') - ->fields('v', ['vid', 'name', 'description']) - ->fields('i18n', ['lid', 'type', 'property', 'objectid']) - ->fields('lt', ['lid', 'translation']) - ->condition('i18n.type', 'vocabulary'); - $query->addField('lt', 'language', 'language'); - // The i18n_strings table has two columns containing the object ID, objectid - // and objectindex. The objectid column is a text field. Therefore, for the - // join to work in PostgreSQL, use the objectindex field as this is numeric - // like the vid field. - $query->join('i18n_strings', 'i18n', 'v.vid = i18n.objectindex'); - $query->leftJoin('locales_target', 'lt', 'lt.lid = i18n.lid'); - - return $query; - } - - /** - * {@inheritdoc} - */ - public function fields() { - return [ - 'vid' => $this->t('The vocabulary ID.'), - 'language' => $this->t('Language for this field.'), - 'property' => $this->t('Name of property being translated.'), - 'translation' => $this->t('Translation of either the title or explanation.'), - ]; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - $ids['vid']['type'] = 'integer'; - return $ids; - } - -} diff -u b/core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTranslationTest.php --- b/core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTranslationTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTranslationTest.php @@ -7,7 +7,7 @@ /** * Tests D6 i18n vocabulary source plugin. * - * @covers \Drupal\taxonomy\Plugin\migrate\source\d6\TaxonomyVocabularyTranslation + * @covers \Drupal\taxonomy\Plugin\migrate\source\d6\VocabularyTranslation * @group taxonomy */ class VocabularyTranslationTest extends MigrateSqlSourceTestBase { only in patch2: unchanged: --- /dev/null +++ b/core/modules/taxonomy/src/Plugin/migrate/source/d6/VocabularyTranslation.php @@ -0,0 +1,57 @@ +select('vocabulary', 'v') + ->fields('v', ['vid', 'name', 'description']) + ->fields('i18n', ['lid', 'type', 'property', 'objectid']) + ->fields('lt', ['lid', 'translation']) + ->condition('i18n.type', 'vocabulary'); + $query->addField('lt', 'language', 'language'); + // The i18n_strings table has two columns containing the object ID, objectid + // and objectindex. The objectid column is a text field. Therefore, for the + // join to work in PostgreSQL, use the objectindex field as this is numeric + // like the vid field. + $query->join('i18n_strings', 'i18n', 'v.vid = i18n.objectindex'); + $query->leftJoin('locales_target', 'lt', 'lt.lid = i18n.lid'); + + return $query; + } + + /** + * {@inheritdoc} + */ + public function fields() { + return [ + 'vid' => $this->t('The vocabulary ID.'), + 'language' => $this->t('Language for this field.'), + 'property' => $this->t('Name of property being translated.'), + 'translation' => $this->t('Translation of either the title or explanation.'), + ]; + } + + /** + * {@inheritdoc} + */ + public function getIds() { + $ids['vid']['type'] = 'integer'; + return $ids; + } + +}