Skip to content

Commit 21e9331

Browse files
BUGFIX: Use reference variable for withoutAuthorizationChecks callback result
Flow's SecurityContext::withoutAuthorizationChecks() has a void return type and does not return the callback result. The previous implementation assumed the return value would be passed through, causing $nodeFromContext to always be null and preventing any nodes from being indexed. This fix captures the result via a reference variable instead.
1 parent 4ea253c commit 21e9331

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Classes/Indexer/NodeIndexer.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ public function indexNode(NodeInterface $node, $targetWorkspace = null): void
277277
};
278278

279279
$handleNode = function (NodeInterface $node, Context $context) use ($targetWorkspace, $indexer) {
280-
$nodeFromContext = $this->securityContext->withoutAuthorizationChecks(
281-
function () use ($context, $node) {
282-
return $context->getNodeByIdentifier($node->getIdentifier());
280+
$nodeFromContext = null;
281+
$this->securityContext->withoutAuthorizationChecks(
282+
function () use ($context, $node, &$nodeFromContext) {
283+
$nodeFromContext = $context->getNodeByIdentifier($node->getIdentifier());
283284
}
284285
);
285286
if ($nodeFromContext instanceof NodeInterface) {

0 commit comments

Comments
 (0)