This code creates invalid redirect.
src/KernelEventListener.php
<?php
private function sendUserToAccessDeniedPage() {
$response = new RedirectResponse('/system/403');
$response->send();
return $response;
}
?>It should be fixed as this.
<?php
private function sendUserToAccessDeniedPage() {
$redirect_url = new \Drupal\Core\Url('system.403');
$response = new RedirectResponse($redirect_url->toString());
$response->send();
return $response;
}
?>| Comment | File | Size | Author |
|---|---|---|---|
| #2 | permissions_by_term-invalid_403_redirect-2.patch | 538 bytes | othermachines |
Comments
Comment #2
othermachines commentedMy installation isn't in a subdirectory, but the invalid redirect is affecting all logged in users. This is on a fresh installation (Drupal 8.3.2).
Fix suggested above works well. I'll attach a patch. Thanks!
Comment #4
jepster_Thanks for the patch! It's applied in the latest dev version.