diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php index 994bf2b..c9b00a7 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php @@ -11,8 +11,10 @@ use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountInterface; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; /** * Provides a 'System Help' block. @@ -79,7 +81,7 @@ public static function create(ContainerInterface $container, array $configuratio */ public function access(AccountInterface $account) { $exception = $this->request->attributes->get('exception'); - if ($exception && in_array($exception->getStatusCode(), array(403, 404))) { + if ($exception instanceof FlattenException && $exception->getStatusCode() >= Response::HTTP_BAD_REQUEST) { return FALSE; } $this->help = $this->getActiveHelp($this->request); @@ -97,8 +99,8 @@ protected function getActiveHelp(Request $request) { $arg = drupal_help_arg(explode('/', $request->attributes->get('_system_path'))); + $router_path = trim($request->getPathInfo(), '/'); foreach ($this->moduleHandler->getImplementations('help') as $module) { - $router_path = trim($request->getPathInfo(), '/'); $function = $module . '_help'; // Lookup help for this path. if ($help = $function($router_path, $arg)) {