Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comments
Comment #1
BerdirFixing title, too much copy & paste
Comment #2
annikaC CreditAttribution: annikaC commentedMade a start on this, attached patch!
What's happening to the hooks for comment_save and comment_delete?
Comment #3
annikaC CreditAttribution: annikaC commentedComment #4
BerdirThe hooks stay, you only need to touch them as far as they mention comment_save()/comment_delete().
Comment #5
BerdirMake 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.
Comment #6
JeroenTReplaced comment_save/comment_delete/comment_delete_multiple($ids) with $comment->save()/$comment->delete()/entity_delete_multiple('comment', $ids). Removed this functions and updated comments.
Comment #8
ddrozdik CreditAttribution: ddrozdik commentedWill be done today during Code Sprint UA.
Comment #9
ddrozdik CreditAttribution: ddrozdik commentedPatch attached.
Comment #10
ddrozdik CreditAttribution: ddrozdik commentedComment #11
ddrozdik CreditAttribution: ddrozdik commentedComment #12
podaroksimple patch, looks like all documentation updated
If bot happy - i`m happy too
RTBC after green bot
Comment #14
ddrozdik CreditAttribution: ddrozdik commentedfixed.
Comment #15
tstoecklerGood thing we have a bot, I missed that one.
Should be $this->comment->save();
Comment #16
ddrozdik CreditAttribution: ddrozdik commentedyeah, but I have changed this line in the #14 patch.
Comment #17
tstoecklerOops, that was a crosspost. Patch looks good.
Comment #18
andypost+1 rtbc, nice clean-up for #731724: Convert comment settings into a field to make them work with CMI and non-node entities
Comment #19
catch#14: comment-remove_comment_save_delete-1999328-14.patch queued for re-testing.
Comment #21
ddrozdik CreditAttribution: ddrozdik commentedreroll.
Comment #23
andypostProper merge, actions now plugins
Comment #24
catchCommitted/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...