From 5baeab7615cab864b8a0bfb5cf73fa9a2f317dce Mon Sep 17 00:00:00 2001 From: webchick Date: Tue, 24 Jun 2014 12:42:56 -0700 Subject: [PATCH] Issue #2290157 by marcingy: Convert comment_user_predelete query to entity query. --- core/modules/comment/comment.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 1ab6691ecc3..6d328ef4d26 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -991,7 +991,9 @@ function comment_user_cancel($edit, $account, $method) { * Implements hook_user_predelete(). */ function comment_user_predelete($account) { - $cids = db_query('SELECT c.cid FROM {comment} c WHERE uid = :uid', array(':uid' => $account->id()))->fetchCol(); + $entity_query = \Drupal::entityQuery('comment'); + $entity_query->condition('uid', $account->id()); + $cids = $entity_query->execute(); entity_delete_multiple('comment', $cids); }