summaryrefslogtreecommitdiffstats
path: root/core/modules/migrate_drupal
diff options
context:
space:
mode:
authorNathaniel Catchpole2018-10-04 13:31:28 (GMT)
committerNathaniel Catchpole2018-10-04 13:31:37 (GMT)
commit53b2cf8b7a943dad0afacfcecb1ac23cbbcfd709 (patch)
tree7a1ab4b02d41fc5556505de30122920173068a3b /core/modules/migrate_drupal
parent5e1827e80aad19945887947624815c100f6208e2 (diff)
Issue #2981392 by masipila, maxocub: Comment migration corrupts data with multilingual sites
(cherry picked from commit b42529c4b97736d114ecd8a02565edbde4b820b0)
Diffstat (limited to 'core/modules/migrate_drupal')
-rw-r--r--core/modules/migrate_drupal/tests/fixtures/drupal6.php150
-rw-r--r--core/modules/migrate_drupal/tests/fixtures/drupal7.php68
2 files changed, 214 insertions, 4 deletions
diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php
index d9b1c2c..169f884 100644
--- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php
+++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php
@@ -1990,6 +1990,38 @@ $connection->insert('comments')
'mail' => '',
'homepage' => '',
))
+->values(array(
+ 'cid' => '7',
+ 'pid' => '0',
+ 'nid' => '21',
+ 'uid' => '1',
+ 'subject' => 'Comment to John Smith - EN',
+ 'comment' => 'This is an English comment.',
+ 'hostname' => '2001:14ba:13f8:300:d9d0:363c:9fe4:66e1',
+ 'timestamp' => '1534014729',
+ 'status' => '0',
+ 'format' => '1',
+ 'thread' => '01/',
+ 'name' => 'root',
+ 'mail' => '',
+ 'homepage' => '',
+))
+->values(array(
+ 'cid' => '8',
+ 'pid' => '0',
+ 'nid' => '22',
+ 'uid' => '1',
+ 'subject' => 'Comment to John Smith - FR',
+ 'comment' => 'This is a French comment.',
+ 'hostname' => '2001:14ba:13f8:300:d9d0:363c:9fe4:66e1',
+ 'timestamp' => '1534014763',
+ 'status' => '0',
+ 'format' => '1',
+ 'thread' => '01/',
+ 'name' => 'root',
+ 'mail' => '',
+ 'homepage' => '',
+))
->execute();
$connection->schema()->createTable('config', array(
@@ -2169,6 +2201,18 @@ $connection->insert('content_field_company')
'field_company_nid' => '15',
))
->values(array(
+ 'vid' => '2002',
+ 'nid' => '21',
+ 'delta' => '0',
+ 'field_company_nid' => NULL,
+))
+->values(array(
+ 'vid' => '2003',
+ 'nid' => '22',
+ 'delta' => '0',
+ 'field_company_nid' => NULL,
+))
+->values(array(
'vid' => '21',
'nid' => '18',
'delta' => '1',
@@ -3518,6 +3562,20 @@ $connection->insert('content_type_employee')
'field_company_2_nid' => '15',
'field_company_3_nid' => '16',
))
+->values(array(
+ 'vid' => '2002',
+ 'nid' => '21',
+ 'field_commander_uid' => NULL,
+ 'field_company_2_nid' => NULL,
+ 'field_company_3_nid' => NULL,
+))
+->values(array(
+ 'vid' => '2003',
+ 'nid' => '22',
+ 'field_commander_uid' => NULL,
+ 'field_company_2_nid' => NULL,
+ 'field_company_3_nid' => NULL,
+))
->execute();
$connection->schema()->createTable('content_type_page', array(
@@ -8666,6 +8724,16 @@ $connection->insert('history')
'nid' => '19',
'timestamp' => '1501955803',
))
+->values(array(
+ 'uid' => '1',
+ 'nid' => '21',
+ 'timestamp' => '1534014729',
+))
+->values(array(
+ 'uid' => '1',
+ 'nid' => '22',
+ 'timestamp' => '1534014763',
+))
->execute();
$connection->schema()->createTable('i18n_blocks', array(
@@ -43733,6 +43801,40 @@ $connection->insert('node')
'tnid' => '12',
'translate' => '0',
))
+->values(array(
+ 'nid' => '21',
+ 'vid' => '2002',
+ 'type' => 'employee',
+ 'language' => 'en',
+ 'title' => 'John Smith - EN',
+ 'uid' => '1',
+ 'status' => '1',
+ 'created' => '1534014650',
+ 'changed' => '1534014650',
+ 'comment' => '2',
+ 'promote' => '1',
+ 'moderate' => '0',
+ 'sticky' => '0',
+ 'tnid' => '21',
+ 'translate' => '0',
+))
+->values(array(
+ 'nid' => '22',
+ 'vid' => '2003',
+ 'type' => 'employee',
+ 'language' => 'fr',
+ 'title' => 'John Smith - FR',
+ 'uid' => '1',
+ 'status' => '1',
+ 'created' => '1534014687',
+ 'changed' => '1534014687',
+ 'comment' => '2',
+ 'promote' => '1',
+ 'moderate' => '0',
+ 'sticky' => '0',
+ 'tnid' => '21',
+ 'translate' => '0',
+))
->execute();
$connection->schema()->createTable('node_access', array(
@@ -43939,6 +44041,20 @@ $connection->insert('node_comment_statistics')
'last_comment_uid' => '1',
'comment_count' => '3',
))
+->values(array(
+ 'nid' => '21',
+ 'last_comment_timestamp' => '1534014729',
+ 'last_comment_name' => '',
+ 'last_comment_uid' => '1',
+ 'comment_count' => '1',
+))
+->values(array(
+ 'nid' => '22',
+ 'last_comment_timestamp' => '1534014763',
+ 'last_comment_name' => '',
+ 'last_comment_uid' => '1',
+ 'comment_count' => '1',
+))
->execute();
$connection->schema()->createTable('node_counter', array(
@@ -44074,6 +44190,18 @@ $connection->insert('node_counter')
'daycount' => '4',
'timestamp' => '1501955803',
))
+->values(array(
+ 'nid' => '21',
+ 'totalcount' => '3',
+ 'daycount' => '3',
+ 'timestamp' => '1534014729',
+))
+->values(array(
+ 'nid' => '22',
+ 'totalcount' => '3',
+ 'daycount' => '3',
+ 'timestamp' => '1534014763',
+))
->execute();
$connection->schema()->createTable('node_revisions', array(
@@ -44402,6 +44530,28 @@ $connection->insert('node_revisions')
'timestamp' => '1390095702',
'format' => '1',
))
+->values(array(
+ 'nid' => '21',
+ 'vid' => '2002',
+ 'uid' => '1',
+ 'title' => 'John Smith - EN',
+ 'body' => 'This is an English Bio text for employee John Smith. There is also a French translation to this node. Both language versions have comments.',
+ 'teaser' => 'This is an English Bio text for employee John Smith. There is also a French translation to this node. Both language versions have comments.',
+ 'log' => '',
+ 'timestamp' => '1534014650',
+ 'format' => '1',
+))
+->values(array(
+ 'nid' => '22',
+ 'vid' => '2003',
+ 'uid' => '1',
+ 'title' => 'John Smith - FR',
+ 'body' => 'This is a French Bio text for employee John Smith. The original node is in English. Both language versions have comments.',
+ 'teaser' => 'This is a French Bio text for employee John Smith. The original node is in English. Both language versions have comments.',
+ 'log' => '',
+ 'timestamp' => '1534014687',
+ 'format' => '1',
+))
->execute();
$connection->schema()->createTable('node_type', array(
diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal7.php b/core/modules/migrate_drupal/tests/fixtures/drupal7.php
index c41b20e..fedfd38 100644
--- a/core/modules/migrate_drupal/tests/fixtures/drupal7.php
+++ b/core/modules/migrate_drupal/tests/fixtures/drupal7.php
@@ -2566,6 +2566,22 @@ $connection->insert('comment')
'homepage' => '',
'language' => 'en',
))
+->values(array(
+ 'cid' => '3',
+ 'pid' => '0',
+ 'nid' => '3',
+ 'uid' => '1',
+ 'subject' => 'Comment to IS translation',
+ 'hostname' => '46.132.185.242',
+ 'created' => '1533031490',
+ 'changed' => '1533031490',
+ 'status' => '1',
+ 'thread' => '01/',
+ 'name' => 'admin',
+ 'mail' => '',
+ 'homepage' => '',
+ 'language' => 'is',
+))
->execute();
$connection->schema()->createTable('contact', array(
@@ -4883,6 +4899,17 @@ $connection->insert('field_data_comment_body')
'comment_body_value' => 'TNG is better than DS9.',
'comment_body_format' => 'filtered_html',
))
+->values(array(
+ 'entity_type' => 'comment',
+ 'bundle' => 'comment_node_article',
+ 'deleted' => '0',
+ 'entity_id' => '3',
+ 'revision_id' => '3',
+ 'language' => 'und',
+ 'delta' => '0',
+ 'comment_body_value' => 'This is a comment to an Icelandic translation.',
+ 'comment_body_format' => 'filtered_html',
+))
->execute();
$connection->schema()->createTable('field_data_description_field', array(
@@ -8737,6 +8764,17 @@ $connection->insert('field_data_subject_field')
'subject_field_value' => 'TNG for the win!',
'subject_field_format' => NULL,
))
+->values(array(
+ 'entity_type' => 'comment',
+ 'bundle' => 'comment_node_article',
+ 'deleted' => '0',
+ 'entity_id' => '3',
+ 'revision_id' => '3',
+ 'language' => 'is',
+ 'delta' => '0',
+ 'subject_field_value' => 'Comment to IS translation',
+ 'subject_field_format' => NULL,
+))
->execute();
$connection->schema()->createTable('field_data_taxonomy_forums', array(
@@ -9202,6 +9240,17 @@ $connection->insert('field_revision_comment_body')
'comment_body_value' => 'TNG is better than DS9.',
'comment_body_format' => 'filtered_html',
))
+->values(array(
+ 'entity_type' => 'comment',
+ 'bundle' => 'comment_node_article',
+ 'deleted' => '0',
+ 'entity_id' => '3',
+ 'revision_id' => '3',
+ 'language' => 'und',
+ 'delta' => '0',
+ 'comment_body_value' => 'This is a comment to an Icelandic translation.',
+ 'comment_body_format' => 'filtered_html',
+))
->execute();
$connection->schema()->createTable('field_revision_description_field', array(
@@ -13083,6 +13132,17 @@ $connection->insert('field_revision_subject_field')
'subject_field_value' => 'TNG for the win!',
'subject_field_format' => NULL,
))
+->values(array(
+ 'entity_type' => 'comment',
+ 'bundle' => 'comment_node_article',
+ 'deleted' => '0',
+ 'entity_id' => '3',
+ 'revision_id' => '3',
+ 'language' => 'is',
+ 'delta' => '0',
+ 'subject_field_value' => 'Comment to IS translation',
+ 'subject_field_format' => NULL,
+))
->execute();
$connection->schema()->createTable('field_revision_taxonomy_forums', array(
@@ -36570,11 +36630,11 @@ $connection->insert('node_comment_statistics')
))
->values(array(
'nid' => '3',
- 'cid' => '0',
- 'last_comment_timestamp' => '1471428152',
- 'last_comment_name' => NULL,
+ 'cid' => '3',
+ 'last_comment_timestamp' => '1533031490',
+ 'last_comment_name' => '',
'last_comment_uid' => '1',
- 'comment_count' => '0',
+ 'comment_count' => '1',
))
->values(array(
'nid' => '4',