From 24343f970b06efe32d6780028c4934f29f285f56 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Sat, 13 Aug 2016 23:52:22 +0100 Subject: [PATCH] Issue #2763283 by naught101, thomas73: Failure on comments with no subject --- .../migrate/source/d6/CommentVariablePerCommentType.php | 2 +- .../src/Unit/Migrate/d6/CommentVariablePerCommentTypeTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariablePerCommentType.php b/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariablePerCommentType.php index ea987be9242..5d16ed0297f 100644 --- a/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariablePerCommentType.php +++ b/core/modules/comment/src/Plugin/migrate/source/d6/CommentVariablePerCommentType.php @@ -20,7 +20,7 @@ class CommentVariablePerCommentType extends CommentVariable { $return = array(); foreach ($node_types as $node_type => $data) { // Only 2 comment types depending on subject field visibility. - if (empty($data['comment_subject_field'])) { + if (!empty($data['comment_subject_field'])) { // Default label and description should be set in migration. $return['comment'] = array( 'comment_type' => 'comment', diff --git a/core/modules/comment/tests/src/Unit/Migrate/d6/CommentVariablePerCommentTypeTest.php b/core/modules/comment/tests/src/Unit/Migrate/d6/CommentVariablePerCommentTypeTest.php index 0055a2ca8ba..75d0932a998 100644 --- a/core/modules/comment/tests/src/Unit/Migrate/d6/CommentVariablePerCommentTypeTest.php +++ b/core/modules/comment/tests/src/Unit/Migrate/d6/CommentVariablePerCommentTypeTest.php @@ -24,10 +24,10 @@ class CommentVariablePerCommentTypeTest extends MigrateSqlSourceTestCase { // Each result will also include a label and description, but those are // static values set by the source plugin and don't need to be asserted. array( - 'comment_type' => 'comment_no_subject', + 'comment_type' => 'comment', ), array( - 'comment_type' => 'comment', + 'comment_type' => 'comment_no_subject', ), );