summaryrefslogtreecommitdiffstats
path: root/core/modules/node/src
diff options
context:
space:
mode:
authorNathaniel Catchpole2017-09-25 13:40:13 (GMT)
committerNathaniel Catchpole2017-09-25 13:40:13 (GMT)
commitb0a7be53fbd99d103cecce2b55ee464ce1da9973 (patch)
tree8cc802b7f2b8571043c4b56cd9181303ac11c98b /core/modules/node/src
parent6487eda3f8397e289291b0ab6bee4889bbc72d0f (diff)
Issue #2902766 by maxocub, masipila, Jo Fitzgerald: Node 'comment open / closed' status not migrated
Diffstat (limited to 'core/modules/node/src')
-rw-r--r--core/modules/node/src/Plugin/migrate/D7NodeDeriver.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php b/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
index da01c70..28c61b8 100644
--- a/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
+++ b/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
@@ -141,6 +141,16 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
$values['source']['node_type'] = $node_type;
$values['destination']['default_bundle'] = $node_type;
+ // Comment status must be mapped to correct comment type.
+ // Comment type migration creates a separate comment type for each
+ // node type except for Forum which uses 'comment_forum'.
+ $comment_type = 'comment_node_' . $node_type;
+ if ($node_type == 'forum') {
+ $comment_type = 'comment_forum';
+ }
+ $nested_key = $comment_type . '/0/status';
+ $values['process'][$nested_key] = 'comment';
+
// If this migration is based on the d7_node_revision migration or
// is for translations of nodes, it should explicitly depend on the
// corresponding d7_node variant.