Remove those functions.

Replace all comment_save($node) calls with $comment->save(), the same for comment_delete().

Remove comment_delete_multiple($ids) with entity_delete_multiple('comment', $ids).

Replace comment references with \Drupal\Core\Entity::save() and so on.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Title: Remove comment_save() and comment_delete()/comment_delete_multiple() in favor of $node->save()/$node->delete() » Remove comment_save() and comment_delete()/comment_delete_multiple() in favor of $comment->save()/$comment->delete()

Fixing title, too much copy & paste

annikaC’s picture

Made a start on this, attached patch!

What's happening to the hooks for comment_save and comment_delete?

annikaC’s picture

Status: Active » Needs review
Berdir’s picture

The hooks stay, you only need to touch them as far as they mention comment_save()/comment_delete().

Berdir’s picture

Status: Needs review » Needs work

Make sure to also remove the actual functions in comment.module.

In the corresponding issue for node_save(), we agreed that it's fine to replace comment_save() with $comment->save() in the documentation.

JeroenT’s picture

Status: Needs work » Needs review
FileSize
10.58 KB

Replaced comment_save/comment_delete/comment_delete_multiple($ids) with $comment->save()/$comment->delete()/entity_delete_multiple('comment', $ids). Removed this functions and updated comments.

Status: Needs review » Needs work

The last submitted patch, comment-remove_comment_save_delete-1999328-6.patch, failed testing.

ddrozdik’s picture

Assigned: Unassigned » ddrozdik

Will be done today during Code Sprint UA.

ddrozdik’s picture

Patch attached.

ddrozdik’s picture

Status: Needs work » Needs review
ddrozdik’s picture

Assigned: ddrozdik » Unassigned
podarok’s picture

Status: Needs review » Reviewed & tested by the community

simple patch, looks like all documentation updated
If bot happy - i`m happy too
RTBC after green bot

Status: Reviewed & tested by the community » Needs work

The last submitted patch, comment-remove_comment_save_delete-1999328.patch, failed testing.

ddrozdik’s picture

Assigned: Unassigned » ddrozdik
Status: Needs work » Needs review
FileSize
14.91 KB

fixed.

tstoeckler’s picture

Assigned: ddrozdik » Unassigned
Status: Needs review » Needs work

Good thing we have a bot, I missed that one.

+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
@@ -113,7 +113,7 @@ function setUp() {
-    comment_save($this->comment);
+    $comment->save();

Should be $this->comment->save();

ddrozdik’s picture

Status: Needs work » Needs review

yeah, but I have changed this line in the #14 patch.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Oops, that was a crosspost. Patch looks good.

andypost’s picture

catch’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Novice, +Entity Field API, +CodeSprintUA

The last submitted patch, comment-remove_comment_save_delete-1999328-14.patch, failed testing.

ddrozdik’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
14.58 KB

reroll.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, comment-remove_comment_save_delete-1999328-21.patch, failed testing.

andypost’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
14.55 KB

Proper merge, actions now plugins

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x thanks!

I missed that this was still testing when committing, if 8.x comes back green that's OK but otherwise will need to revert...

Automatically closed -- issue fixed for 2 weeks with no activity.