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 dd38073..994bf2b 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php @@ -78,6 +78,10 @@ public static function create(ContainerInterface $container, array $configuratio * {@inheritdoc} */ public function access(AccountInterface $account) { + $exception = $this->request->attributes->get('exception'); + if ($exception && in_array($exception->getStatusCode(), array(403, 404))) { + return FALSE; + } $this->help = $this->getActiveHelp($this->request); return (bool) $this->help; } @@ -94,7 +98,7 @@ protected function getActiveHelp(Request $request) { $arg = drupal_help_arg(explode('/', $request->attributes->get('_system_path'))); foreach ($this->moduleHandler->getImplementations('help') as $module) { - $router_path = current_path(); + $router_path = trim($request->getPathInfo(), '/'); $function = $module . '_help'; // Lookup help for this path. if ($help = $function($router_path, $arg)) {