Loading role_watchdog.module +6 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,12 @@ function role_watchdog_save_entity($name, $uid, $action, $user_performed_on, arr * Implements hook_ENTITY_TYPE_delete(). */ function role_watchdog_user_delete(EntityInterface $account) { // TODO: different actions according to account cancellation. // Deleting all the role watchdog entities created because of a particular user. $query = \Drupal::entityQuery('role_watchdog')->condition('field_user_performed_on', $account->id()); $ids = $query->execute(); $storage_handler = \Drupal::entityTypeManager()->getStorage('role_watchdog'); $entities = $storage_handler->loadMultiple($ids); $storage_handler->delete($entities); } /** Loading Loading
role_watchdog.module +6 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,12 @@ function role_watchdog_save_entity($name, $uid, $action, $user_performed_on, arr * Implements hook_ENTITY_TYPE_delete(). */ function role_watchdog_user_delete(EntityInterface $account) { // TODO: different actions according to account cancellation. // Deleting all the role watchdog entities created because of a particular user. $query = \Drupal::entityQuery('role_watchdog')->condition('field_user_performed_on', $account->id()); $ids = $query->execute(); $storage_handler = \Drupal::entityTypeManager()->getStorage('role_watchdog'); $entities = $storage_handler->loadMultiple($ids); $storage_handler->delete($entities); } /** Loading