Skip to content
Snippets Groups Projects
Commit 5baeab76 authored by Angie Byron's avatar Angie Byron
Browse files

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

parent fdfd3c7d
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment