Commit 8d184707 authored by webchick's avatar webchick

Issue #2313241 by aleksip, benjy: Fixed d6_taxonomy_term migrate fails when...

Issue #2313241 by aleksip, benjy: Fixed d6_taxonomy_term migrate fails when the parent term has not been already migrated.
parent 5baf8db0
<?php
/**
* @file
* Contains \Drupal\migrate\Plugin\migrate\destination\EntityTaxonomyTerm.
*/
namespace Drupal\migrate\Plugin\migrate\destination;
use Drupal\migrate\Row;
/**
* @MigrateDestination(
* id = "entity:taxonomy_term"
* )
*/
class EntityTaxonomyTerm extends EntityContentBase {
/**
* {@inheritdoc}
*/
protected function getEntity(Row $row, array $old_destination_id_values) {
if ($row->stub()) {
$row->setDestinationProperty('name', $this->t('Stub name for source tid:') . $row->getSourceProperty('tid'));
}
return parent::getEntity($row, $old_destination_id_values);
}
}
......@@ -150,7 +150,7 @@ public function load() {
))
->values(array(
'tid' => '1',
'parent' => '0',
'parent' => '2',
))
->values(array(
'tid' => '2',
......
......@@ -51,7 +51,7 @@ public function testTaxonomyTerms() {
'source_vid' => 1,
'vid' => 'vocabulary_1_i_0_',
'weight' => 0,
'parent' => array(0),
'parent' => array(2),
),
'2' => array(
'source_vid' => 2,
......
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