Commit e09eb5ea authored by webchick's avatar webchick

Issue #2054213 by StephaneQ, andypost: Deprecate comment_load_multiple() in...

Issue #2054213 by StephaneQ, andypost: Deprecate comment_load_multiple() in favour of entity_load_multiple().
parent a40485a5
......@@ -902,7 +902,7 @@ function comment_links(CommentInterface $comment, EntityInterface $entity, $fiel
* Constructs render array from an array of loaded comments.
*
* @param $comments
* An array of comments as returned by comment_load_multiple().
* An array of comments as returned by entity_load_multiple().
* @param $view_mode
* View mode, e.g. 'full', 'teaser'...
* @param $langcode
......@@ -1135,7 +1135,7 @@ function comment_node_update_index(EntityInterface $node, $langcode) {
$mode = $instance->getFieldSetting('default_mode');
$comments_per_page = $instance->getFieldSetting('per_page');
if ($node->get($field_name)->status && $cids = comment_get_thread($node, $field_name, $mode, $comments_per_page)) {
$comments = comment_load_multiple($cids);
$comments = entity_load_multiple('comment', $cids);
comment_prepare_thread($comments);
$build = comment_view_multiple($comments);
$return .= drupal_render($build);
......@@ -1219,6 +1219,8 @@ function comment_user_predelete($account) {
/**
* Loads comment entities from the database.
*
* @deprecated Use entity_load_multiple('comment', $cids) instead.
*
* @param array $cids
* (optional) An array of entity IDs. If omitted, all entities are loaded.
* @param bool $reset
......
......@@ -62,7 +62,7 @@ public function preRender($result) {
$cids[] = $row->cid;
}
$this->comments = comment_load_multiple($cids);
$this->comments = entity_load_multiple('comment', $cids);
foreach ($this->comments as $comment) {
$comment->depth = count(explode('.', $comment->thread->value)) - 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment