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() {
'weight' => 9,
);
$modules = Drupal::moduleHandler()->getImplementations('help');
ksort($modules);
foreach ($modules as $module) {
$items['admin/help/' . $module] = array(
'title' => $module,
'route_name' => 'help_page',
'type' => MENU_VISIBLE_IN_BREADCRUMB,
);
}
$items['admin/help/%'] = array(
'route_name' => 'help_page',
'type' => MENU_VISIBLE_IN_BREADCRUMB,
);
return $items;
}
......
......@@ -9,6 +9,7 @@
use Drupal\Core\Controller\ControllerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Controller routines for help routes.
......@@ -98,6 +99,8 @@ protected function helpLinksAsList() {
*
* @return array
* A render array as expected by drupal_render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
public function helpPage($name) {
$build = array();
......@@ -132,9 +135,11 @@ public function helpPage($name) {
'#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