Problem/Motivation

comment_load_multiple() is useless wrapper to entity_load_multiple()

Proposed resolution

Replace calls to corresponding:
comment_load_multiple($cids) => entity_load_multiple('comment', $cids)

Remaining tasks

  • Create a patch (5 places to patch)
  • Commit a patch

Related issue #1757586: Remove MODULE_load*() & Co functions in favor of entity_*() functions

Files: 
CommentFileSizeAuthor
#15 drupal8.comment-module.2054213-15.patch2.12 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 58,871 pass(es).
[ View ]
#12 deprecate-comment-load-multiple-2054213-12.patch3.33 KBStephaneQ
PASSED: [[SimpleTest]]: [MySQL] 58,844 pass(es).
[ View ]
#9 deprecate-comment-load-multiple-2054213-9.patch3.3 KBStephaneQ
PASSED: [[SimpleTest]]: [MySQL] 57,862 pass(es).
[ View ]
#9 interdiff-7-9.txt563 bytesStephaneQ
#7 deprecate-comment-load-multiple-2054213-7.patch3.3 KBStephaneQ
PASSED: [[SimpleTest]]: [MySQL] 57,914 pass(es).
[ View ]
#7 interdiff-2-7.txt518 bytesStephaneQ
#4 deprecate-comment-load-multiple-2054213-4.patch3.66 KBStephaneQ
PASSED: [[SimpleTest]]: [MySQL] 57,595 pass(es).
[ View ]
#4 interdiff.txt887 bytesStephaneQ
#2 deprecate-comment-load-multiple-2054213-2.patch2.99 KBStephaneQ
PASSED: [[SimpleTest]]: [MySQL] 57,680 pass(es).
[ View ]

Comments

Issue tags:+Entity system, +API clean-up

taggin

Status:Active» Needs review
StatusFileSize
new2.99 KB
PASSED: [[SimpleTest]]: [MySQL] 57,680 pass(es).
[ View ]

Should I remove the function ?

Yes please

StatusFileSize
new887 bytes
new3.66 KB
PASSED: [[SimpleTest]]: [MySQL] 57,595 pass(es).
[ View ]

Status:Needs review» Reviewed & tested by the community

Awesome!

$ git grep comment_load_multiple
core/modules/comment/comment.admin.inc:  $comments = comment_load_multiple($cids);
core/modules/comment/comment.module:      $comments = comment_load_multiple($cids);
core/modules/comment/comment.module: *   An array of comments as returned by comment_load_multiple().
core/modules/comment/comment.module:      $comments = comment_load_multiple($cids);
core/modules/comment/comment.module:function comment_load_multiple(array $cids = NULL, $reset = FALSE) {
core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php:    $this->comments = comment_load_multiple($cids);

Status:Reviewed & tested by the community» Needs work

It's post-API freeze, so that function needs to be marked @deprecated rather than removed, according to http://buytaert.net/drupal-8-api-freeze.

Status:Needs work» Needs review
StatusFileSize
new518 bytes
new3.3 KB
PASSED: [[SimpleTest]]: [MySQL] 57,914 pass(es).
[ View ]

Ok, here is the change.

Status:Needs review» Needs work

+++ b/core/modules/comment/comment.moduleundefined
@@ -1280,6 +1280,8 @@ function comment_user_predelete($account) {
+ * @deprecated use entity_load_multiple('comment', $cids) instead.

should be Use

Sorry for the bum steer at #3

StatusFileSize
new563 bytes
new3.3 KB
PASSED: [[SimpleTest]]: [MySQL] 57,862 pass(es).
[ View ]

Np :)
I get the deprecated statement from taxonomy.module (*_load_multiple functions) so the capital is missing there too.

Status:Needs work» Needs review

Forgot the status

Status:Needs review» Needs work
Issue tags:+Needs reroll

drop is moving

Status:Needs work» Needs review
StatusFileSize
new3.33 KB
PASSED: [[SimpleTest]]: [MySQL] 58,844 pass(es).
[ View ]

Rerolling

Status:Needs review» Reviewed & tested by the community

Awesome!

Status:Reviewed & tested by the community» Needs work

Patch no longer applies.

Status:Needs work» Reviewed & tested by the community
Issue tags:-Needs reroll
StatusFileSize
new2.12 KB
PASSED: [[SimpleTest]]: [MySQL] 58,871 pass(es).
[ View ]

There's only 2 left

Status:Reviewed & tested by the community» Fixed

Hm. Not sure I like this general direction of moving away from targeted wrapper functions, but in a quick grep it shows that the ship has already sailed, apparently.

Committed and pushed to 8.x.

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