Skip to content

Commit

Permalink
fixed: prevent reindexing of prevented entities
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed Jul 13, 2023
1 parent 3ccf7cf commit 65f377d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions classes/ColdTrick/OpenSearch/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ protected static function checkElggIndex(): void {
]);
/* @var $entity \ElggEntity */
foreach ($reindex as $entity) {
// is this entity prevented from being indexed
$event_params = [
'entity' => $entity,
];

if ((bool) elgg_trigger_event_results('index:entity:prevent', 'opensearch', $event_params, false)) {
continue;
}

// mark for reindex
elgg_call(ELGG_DISABLE_SYSTEM_LOG, function() use ($entity) {
$entity->{OPENSEARCH_INDEXED_NAME} = 0;
Expand Down

0 comments on commit 65f377d

Please sign in to comment.