Commit fcb24f94 authored by catch's avatar catch

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

parent 21d59b50
......@@ -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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment