diff --git a/core/modules/comment/comment.admin.inc b/core/modules/comment/comment.admin.inc index 488c2f9..61ff77a 100644 --- a/core/modules/comment/comment.admin.inc +++ b/core/modules/comment/comment.admin.inc @@ -186,7 +186,7 @@ function comment_admin_overview_submit($form, &$form_state) { $cids = $form_state['values']['comments']; if ($operation == 'delete') { - comment_delete_multiple($cids); + entity_delete_multiple('comment', $cids); } else { foreach ($cids as $cid => $value) { @@ -198,7 +198,7 @@ function comment_admin_overview_submit($form, &$form_state) { elseif ($operation == 'publish') { $comment->status->value = COMMENT_PUBLISHED; } - comment_save($comment); + $comment->save(); } } drupal_set_message(t('The update has been performed.')); @@ -250,7 +250,7 @@ function comment_multiple_delete_confirm($form, &$form_state) { */ function comment_multiple_delete_confirm_submit($form, &$form_state) { if ($form_state['values']['confirm']) { - comment_delete_multiple(array_keys($form_state['values']['comments'])); + entity_delete_multiple('comment', array_keys($form_state['values']['comments'])); cache_invalidate_tags(array('content' => TRUE)); $count = count($form_state['values']['comments']); watchdog('content', 'Deleted @count comments.', array('@count' => $count)); diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 0c2cd55..eabdb21 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1207,7 +1207,7 @@ function comment_node_insert(EntityInterface $node) { */ function comment_node_predelete(EntityInterface $node) { $cids = db_query('SELECT cid FROM {comment} WHERE nid = :nid', array(':nid' => $node->nid))->fetchCol(); - comment_delete_multiple($cids); + entity_delete_multiple('comment', $cids); db_delete('node_comment_statistics') ->condition('nid', $node->nid) ->execute(); @@ -1286,7 +1286,7 @@ function comment_user_cancel($edit, $account, $method) { $comments = entity_load_multiple_by_properties('comment', array('uid' => $account->uid)); foreach ($comments as $comment) { $comment->status->value = 0; - comment_save($comment); + $comment->save(); } break; @@ -1294,7 +1294,7 @@ function comment_user_cancel($edit, $account, $method) { $comments = entity_load_multiple_by_properties('comment', array('uid' => $account->uid)); foreach ($comments as $comment) { $comment->uid->target_id = 0; - comment_save($comment); + $comment->save(); } break; } @@ -1305,7 +1305,7 @@ function comment_user_cancel($edit, $account, $method) { */ function comment_user_predelete($account) { $cids = db_query('SELECT c.cid FROM {comment} c WHERE uid = :uid', array(':uid' => $account->uid))->fetchCol(); - comment_delete_multiple($cids); + entity_delete_multiple('comment', $cids); } /** @@ -1928,7 +1928,7 @@ function comment_unpublish_by_keyword_action_submit($form, $form_state) { * @ingroup actions */ function comment_save_action(Comment $comment) { - comment_save($comment); + $comment->save(); cache_invalidate_tags(array('content' => TRUE)); watchdog('action', 'Saved comment %title', array('%title' => $comment->subject->value)); } diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index 179410c..d0f6159 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -318,7 +318,7 @@ public function save(array $form, array &$form_state) { user_cookie_save(array_intersect_key($form_state['values'], array_flip(array('name', 'mail', 'homepage')))); } - comment_save($comment); + $comment->save(); $form_state['values']['cid'] = $comment->id(); // Add an entry to the watchdog log. diff --git a/core/modules/comment/lib/Drupal/comment/CommentStorageController.php b/core/modules/comment/lib/Drupal/comment/CommentStorageController.php index c005cb0..b7e063a 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentStorageController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentStorageController.php @@ -178,7 +178,7 @@ protected function postDelete($comments) { ->fields('c', array('cid')) ->condition('pid', array(array_keys($comments)), 'IN'); $child_cids = $query->execute()->fetchCol(); - comment_delete_multiple($child_cids); + entity_delete_multiple('comment', $child_cids); foreach ($comments as $comment) { $this->updateNodeStatistics($comment->nid->target_id); diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php index 1294de4..17e47ba 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php @@ -57,7 +57,7 @@ function testCommentClasses() { 'language' => LANGUAGE_NOT_SPECIFIED, 'comment_body' => array(LANGUAGE_NOT_SPECIFIED => array($this->randomName())), )); - comment_save($comment); + $comment->save(); // Adjust the current/viewing user. switch ($case['user']) { diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php index 5585650..f472dda 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php @@ -149,7 +149,7 @@ function setEnvironment(array $info) { 'langcode' => LANGUAGE_NOT_SPECIFIED, 'comment_body' => array(LANGUAGE_NOT_SPECIFIED => array($this->randomName())), )); - comment_save($comment); + $comment->save(); $this->comment = $comment; // comment_num_new() relies on history_read(), so ensure that no one has @@ -158,7 +158,7 @@ function setEnvironment(array $info) { } else { $cids = db_query("SELECT cid FROM {comment}")->fetchCol(); - comment_delete_multiple($cids); + entity_delete_multiple('comment', $cids); unset($this->comment); } } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php index 818227e..b1ef4f7 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php @@ -56,7 +56,7 @@ public function testCommentNewCommentsIndicator() { 'langcode' => LANGUAGE_NOT_SPECIFIED, 'comment_body' => array(LANGUAGE_NOT_SPECIFIED => array($this->randomName())), )); - comment_save($comment); + $comment->save(); $this->drupalLogout(); // Log in with 'web user' and check comment links. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php index 46d0318..900f88c 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php @@ -84,7 +84,7 @@ public function setUp() { $comment->comment_body->value = 'Test body ' . $i; $comment->comment_body->format = 'full_html'; - comment_save($comment); + $comment->save(); } // Store all the nodes just created to access their properties on the tests.