When this code is executed, I have an error message logged.
The code is in shared_node_access(NodeInterface $node, $op, AccountInterface $account)
if ($node->get('nid')->value == 1) {
if ($account->isAnonymous()) {
}
else {
$path = Url::fromUserInput('/node/25')->toString();
$response = new RedirectResponse($path);
$response->send();
}
}
The error message:
RuntimeException : Failed to start the session because headers have already been sent by "/home/lejardindf/JdP8/vendor/symfony/http-foundation/Response.php" at line 377. dans Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (/home/lejardindf/JdP8/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php ligne 150)