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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

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

taggin

StephaneQ’s picture

Status: Active » Needs review
FileSize
2.99 KB

Should I remove the function ?

larowlan’s picture

Yes please

StephaneQ’s picture

andypost’s picture

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);
webchick’s picture

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.

StephaneQ’s picture

Status: Needs work » Needs review
FileSize
518 bytes
3.3 KB

Ok, here is the change.

larowlan’s picture

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

StephaneQ’s picture

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

StephaneQ’s picture

Status: Needs work » Needs review

Forgot the status

andypost’s picture

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

drop is moving

StephaneQ’s picture

Status: Needs work » Needs review
FileSize
3.33 KB

Rerolling

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Awesome!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Patch no longer applies.

andypost’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll
FileSize
2.12 KB

There's only 2 left

webchick’s picture

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.