diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc index ca0f432..cdd7ec0 100644 --- a/core/modules/comment/comment.views.inc +++ b/core/modules/comment/comment.views.inc @@ -88,13 +88,6 @@ function comment_views_data_alter(&$data) { ), ); } - $data['comment']['comment_bulk_form'] = array( - 'title' => t('Comment operations bulk form'), - 'help' => t('Add a form element that lets you run operations on multiple comments.'), - 'field' => array( - 'id' => 'comment_bulk_form', - ), - ); } } } diff --git a/core/modules/comment/src/CommentViewsData.php b/core/modules/comment/src/CommentViewsData.php index 2a7083c..968b462 100644 --- a/core/modules/comment/src/CommentViewsData.php +++ b/core/modules/comment/src/CommentViewsData.php @@ -148,6 +148,14 @@ public function getViewsData() { ), ); + $data['comment']['comment_bulk_form'] = array( + 'title' => t('Comment operations bulk form'), + 'help' => t('Add a form element that lets you run operations on multiple comments.'), + 'field' => array( + 'id' => 'comment_bulk_form', + ), + ); + $data['comment_field_data']['thread']['field'] = array( 'title' => t('Depth'), 'help' => t('Display the depth of the comment if it is threaded.'), diff --git a/core/modules/views/src/Tests/DefaultViewsTest.php b/core/modules/views/src/Tests/DefaultViewsTest.php index c17067e..8a06886 100644 --- a/core/modules/views/src/Tests/DefaultViewsTest.php +++ b/core/modules/views/src/Tests/DefaultViewsTest.php @@ -108,6 +108,15 @@ protected function setUp() { 'field_name' => 'comment' ); entity_create('comment', $comment)->save(); + + $comment = array( + 'uid' => $user->id(), + 'status' => CommentInterface::NOT_PUBLISHED, + 'entity_id' => $node->id(), + 'entity_type' => 'node', + 'field_name' => 'comment' + ); + entity_create('comment', $comment)->save(); } // Some views, such as the "Who's Online" view, only return results if at @@ -140,6 +149,10 @@ public function testDefaultViews() { $tokens = array('@name' => $name, '@display_id' => $display_id); $this->assertTrue($view->executed, format_string('@name:@display_id has been executed.', $tokens)); + + $count = count($view->result); + $this->assertTrue($count > 0, format_string('@count results returned', array('@count' => $count))); + $view->destroy(); } } }