Skip to content

Commit

Permalink
Make sure to index nodes only if they are accessible to anonymous users
Browse files Browse the repository at this point in the history
  • Loading branch information
almasaeed2010 committed Dec 11, 2017
1 parent caa0438 commit 76ccb5f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions includes/Jobs/NodesIndexJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ protected function loadContent($records) {
if (!isset($nodes[$record->nid])) {
continue;
}

$node = $nodes[$record->nid];

if(!node_access('view', $node)) {
// Anonymous user is not allowed to access this node
// so don't index it
continue;
}

$modules = module_implements('node_view');
foreach ($modules as $module) {
module_invoke($module, 'node_view', $node, 'full', NULL);
Expand Down

0 comments on commit 76ccb5f

Please sign in to comment.