Skip to content
Snippets Groups Projects
Commit 33038d63 authored by David Burkhart's avatar David Burkhart
Browse files

Issue #3357719: Add access checks to entity queries

parent 1d17c808
Branches
No related tags found
1 merge request!9Issue #3357719: Add access checks to entity queries
......@@ -125,16 +125,18 @@ function log_entity_operations_entity_cron() {
if (!empty($date_limit)) {
$date = date('Y-m-d\TH:i:s', strtotime($date_limit));
$logs_to_delete = array_merge($logs_to_delete, \Drupal::entityQuery('entity_operation_log')
->accessCheck(FALSE)
->condition('operation_time', $date, '<')
->execute());
}
$row_limit = $config->get('row_limit');
if ($row_limit >= 1) {
$row_from_query_result = \Drupal::entityQuery('entity_operation_log')->sort('id', 'DESC')->range($config->get('row_limit') - 1, 1)->execute();
$row_from_query_result = \Drupal::entityQuery('entity_operation_log')->accessCheck(FALSE)->sort('id', 'DESC')->range($config->get('row_limit') - 1, 1)->execute();
if (!empty($row_from_query_result)) {
$row_from_id = reset($row_from_query_result);
$logs_to_delete = array_merge($logs_to_delete, \Drupal::entityQuery('entity_operation_log')
->accessCheck(FALSE)
->condition('id', $row_from_id, '<')
->execute());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment