Commit 727beadf authored by catch's avatar catch
Browse files

Issue #2691641 by Jo Fitzgerald, benjy: D7 taxonomy description format not migrating

(cherry picked from commit 327f8e38)
parent b6115049
Loading
Loading
Loading
Loading
+2 −1
Changes for core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@ process:
    migration: d7_taxonomy_vocabulary
    source: vid
  name: name
  description: description
  'description/value': description
  'description/format': format
  weight: weight
  parent:
    plugin: migration
+12 −9
Changes for core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php: 12 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -35,18 +35,21 @@ protected function setUp() {
   *   The parent vocabulary the migrated entity should have.
   * @param string $expected_description
   *   The description the migrated entity should have.
   * @param string $expected_format
   *   The format the migrated entity should have.
   * @param int $expected_weight
   *   The weight the migrated entity should have.
   * @param array $expected_parents
   *   The parent terms the migrated entity should have.
   */
  protected function assertEntity($id, $expected_label, $expected_vid, $expected_description = '', $expected_weight = 0, $expected_parents = []) {
  protected function assertEntity($id, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, $expected_parents = []) {
    /** @var \Drupal\taxonomy\TermInterface $entity */
    $entity = Term::load($id);
    $this->assertTrue($entity instanceof TermInterface);
    $this->assertIdentical($expected_label, $entity->label());
    $this->assertIdentical($expected_vid, $entity->getVocabularyId());
    $this->assertEqual($expected_description, $entity->getDescription());
    $this->assertEquals($expected_format, $entity->getFormat());
    $this->assertEqual($expected_weight, $entity->getWeight());
    $this->assertIdentical($expected_parents, $this->getParentIDs($id));
  }
@@ -55,14 +58,14 @@ protected function assertEntity($id, $expected_label, $expected_vid, $expected_d
   * Tests the Drupal 7 taxonomy term to Drupal 8 migration.
   */
  public function testTaxonomyTerms() {
    $this->assertEntity(1, 'General discussion', 'forums', '', 2);
    $this->assertEntity(2, 'Term1', 'test_vocabulary', 'The first term.');
    $this->assertEntity(3, 'Term2', 'test_vocabulary', 'The second term.');
    $this->assertEntity(4, 'Term3', 'test_vocabulary', 'The third term.', 0, [3]);
    $this->assertEntity(5, 'Custom Forum', 'forums', 'Where the cool kids are.', 3);
    $this->assertEntity(6, 'Games', 'forums', '', 4);
    $this->assertEntity(7, 'Minecraft', 'forums', '', 1, [6]);
    $this->assertEntity(8, 'Half Life 3', 'forums', '', 0, [6]);
    $this->assertEntity(1, 'General discussion', 'forums', '', NULL, 2);
    $this->assertEntity(2, 'Term1', 'test_vocabulary', 'The first term.', 'filtered_html');
    $this->assertEntity(3, 'Term2', 'test_vocabulary', 'The second term.', 'filtered_html');
    $this->assertEntity(4, 'Term3', 'test_vocabulary', 'The third term.', 'full_html', 0, [3]);
    $this->assertEntity(5, 'Custom Forum', 'forums', 'Where the cool kids are.', NULL, 3);
    $this->assertEntity(6, 'Games', 'forums', '', NULL, 4);
    $this->assertEntity(7, 'Minecraft', 'forums', '', NULL, 1, [6]);
    $this->assertEntity(8, 'Half Life 3', 'forums', '', NULL, 0, [6]);
  }

  /**