Commit 5baeab76 authored by webchick's avatar webchick
Browse files

Issue #2290157 by marcingy: Convert comment_user_predelete query to entity query.

parent fdfd3c7d
...@@ -991,7 +991,9 @@ function comment_user_cancel($edit, $account, $method) { ...@@ -991,7 +991,9 @@ function comment_user_cancel($edit, $account, $method) {
* Implements hook_user_predelete(). * Implements hook_user_predelete().
*/ */
function comment_user_predelete($account) { 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); entity_delete_multiple('comment', $cids);
} }
......
Supports Markdown
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