.../Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php | 5 ++--- .../Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php | 2 +- core/modules/system/src/Tests/System/AccessDeniedTest.php | 3 +++ core/modules/system/src/Tests/System/PageNotFoundTest.php | 3 +++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php index e306b38..623ba09 100644 --- a/core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php @@ -8,7 +8,6 @@ namespace Drupal\Core\EventSubscriber; use Drupal\Core\Access\AccessManagerInterface; -use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Cache\RefinableCacheableDependencyInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Routing\AccessAwareRouterInterface; @@ -52,7 +51,7 @@ class CustomPageExceptionHtmlSubscriber extends DefaultExceptionHtmlSubscriber { * The redirect destination service. * @param \Symfony\Component\Routing\Matcher\UrlMatcherInterface $access_unaware_router * A router implementation which does not check access. - * @param \Drupal\Core\Access\AccessManagerInterface + * @param \Drupal\Core\Access\AccessManagerInterface $access_manager * The access manager. */ public function __construct(ConfigFactoryInterface $config_factory, HttpKernelInterface $http_kernel, LoggerInterface $logger, RedirectDestinationInterface $redirect_destination, UrlMatcherInterface $access_unaware_router, AccessManagerInterface $access_manager) { @@ -92,7 +91,7 @@ public function on404(GetResponseForExceptionEvent $event) { * Makes a subrequest to retrieve the custom error page. * * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event - * The event to process + * The event to process. * @param string $custom_path * The custom path to which to make a subrequest for this error message. * @param int $status_code diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php index bd9a6f3..153253a 100644 --- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php @@ -118,7 +118,7 @@ public function on404(GetResponseForExceptionEvent $event) { * Makes a subrequest to retrieve the default error page. * * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event - * The event to process + * The event to process. * @param string $url * The path/url to which to make a subrequest for this error message. * @param int $status_code diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php index 100e974..db231c3 100644 --- a/core/modules/system/src/Tests/System/AccessDeniedTest.php +++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php @@ -112,6 +112,9 @@ function testAccessDenied() { $this->assertText(t('Basic site settings')); } + /** + * Tests that an inaccessible custom 403 page falls back to the default. + */ public function testAccessDeniedCustomPageWithAccessDenied() { // Sets up a 403 page not accessible by the anonymous user. $this->config('system.site')->set('page.403', '/system-test/custom-4xx')->save(); diff --git a/core/modules/system/src/Tests/System/PageNotFoundTest.php b/core/modules/system/src/Tests/System/PageNotFoundTest.php index 17ad8d7..ffe985b 100644 --- a/core/modules/system/src/Tests/System/PageNotFoundTest.php +++ b/core/modules/system/src/Tests/System/PageNotFoundTest.php @@ -61,6 +61,9 @@ function testPageNotFound() { $this->assertText($this->adminUser->getUsername(), 'Found the custom 404 page'); } + /** + * Tests that an inaccessible custom 404 page falls back to the default. + */ public function testPageNotFoundCustomPageWithAccessDenied() { // Sets up a 404 page not accessible by the anonymous user. $this->config('system.site')->set('page.404', '/system-test/custom-4xx')->save();