Skip to content
Snippets Groups Projects
Commit fcb24f94 authored by catch's avatar catch
Browse files

Issue #1618458 by Cottser, Jody Lynn, grndlvl: Fixed help_menu() creates unnecessary router items.

parent 21d59b50
No related branches found
No related tags found
No related merge requests found
...@@ -16,15 +16,10 @@ function help_menu() { ...@@ -16,15 +16,10 @@ function help_menu() {
'weight' => 9, 'weight' => 9,
); );
$modules = Drupal::moduleHandler()->getImplementations('help'); $items['admin/help/%'] = array(
ksort($modules); 'route_name' => 'help_page',
foreach ($modules as $module) { 'type' => MENU_VISIBLE_IN_BREADCRUMB,
$items['admin/help/' . $module] = array( );
'title' => $module,
'route_name' => 'help_page',
'type' => MENU_VISIBLE_IN_BREADCRUMB,
);
}
return $items; return $items;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\Controller\ControllerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/** /**
* Controller routines for help routes. * Controller routines for help routes.
...@@ -98,6 +99,8 @@ protected function helpLinksAsList() { ...@@ -98,6 +99,8 @@ protected function helpLinksAsList() {
* *
* @return array * @return array
* A render array as expected by drupal_render(). * A render array as expected by drupal_render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/ */
public function helpPage($name) { public function helpPage($name) {
$build = array(); $build = array();
...@@ -132,9 +135,11 @@ public function helpPage($name) { ...@@ -132,9 +135,11 @@ public function helpPage($name) {
'#links' => $links, '#links' => $links,
); );
} }
return $build;
}
else {
throw new NotFoundHttpException();
} }
return $build;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment