Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
log_entity_operations
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
log_entity_operations
Commits
33038d63
Commit
33038d63
authored
May 2, 2023
by
David Burkhart
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3357719
: Add access checks to entity queries
parent
1d17c808
Branches
Branches containing commit
No related tags found
1 merge request
!9
Issue #3357719: Add access checks to entity queries
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
log_entity_operations_entity/log_entity_operations_entity.module
+3
-1
3 additions, 1 deletion
...ity_operations_entity/log_entity_operations_entity.module
with
3 additions
and
1 deletion
log_entity_operations_entity/log_entity_operations_entity.module
+
3
−
1
View file @
33038d63
...
...
@@ -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
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment