diff --git a/core/modules/action/action.module b/core/modules/action/action.module
index 35a91b2a4058..8e11de1a5f6f 100644
--- a/core/modules/action/action.module
+++ b/core/modules/action/action.module
@@ -5,12 +5,12 @@
* This is the Actions module for executing stored actions.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function action_help($route_name, Request $request) {
+function action_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.action':
$output = '';
diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module
index 80edea98f9ca..64eb2756fee2 100644
--- a/core/modules/aggregator/aggregator.module
+++ b/core/modules/aggregator/aggregator.module
@@ -8,7 +8,7 @@
use Drupal\aggregator\Entity\Feed;
use Drupal\aggregator\FeedInterface;
use Drupal\Component\Utility\Xss;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Denotes that a feed's items should never expire.
@@ -18,7 +18,7 @@ const AGGREGATOR_CLEAR_NEVER = 0;
/**
* Implements hook_help().
*/
-function aggregator_help($route_name, Request $request) {
+function aggregator_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.aggregator':
$output = '';
diff --git a/core/modules/ban/ban.module b/core/modules/ban/ban.module
index f36a26591add..2d048d4d432d 100644
--- a/core/modules/ban/ban.module
+++ b/core/modules/ban/ban.module
@@ -5,12 +5,12 @@
* Allows to ban individual IP addresses.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function ban_help($route_name, Request $request) {
+function ban_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.ban':
$output = '';
diff --git a/core/modules/basic_auth/basic_auth.module b/core/modules/basic_auth/basic_auth.module
index f8fd225a9c73..9c09ce2e9264 100644
--- a/core/modules/basic_auth/basic_auth.module
+++ b/core/modules/basic_auth/basic_auth.module
@@ -5,12 +5,12 @@
* Provides an HTTP Basic authentication provider.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function basic_auth_help($route_name, Request $request) {
+function basic_auth_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.basic_auth':
$output = '';
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 69030dfd6283..4681b8a550b4 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -6,14 +6,14 @@
*/
use Drupal\block\BlockInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\language\Entity\Language;
use Drupal\system\Entity\Menu;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function block_help($route_name, Request $request) {
+function block_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.block':
$output = '';
@@ -37,7 +37,7 @@ function block_help($route_name, Request $request) {
return $output;
}
if ($route_name == 'block.admin_display' || $route_name == 'block.admin_display_theme') {
- $demo_theme = $request->attributes->get('theme', \Drupal::config('system.theme')->get('default'));
+ $demo_theme = $route_match->getParameter('theme') ?: \Drupal::config('system.theme')->get('default');
$themes = list_themes();
$output = '
' . t('This page provides a drag-and-drop interface for adding a block to a region, and for controlling the order of blocks within regions. To add a block to a region, or to configure its specific title and visibility settings, click the block title under Place blocks. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
';
$output .= '' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '
';
diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module
index 96ff041e0037..706fa691e461 100644
--- a/core/modules/block_content/block_content.module
+++ b/core/modules/block_content/block_content.module
@@ -5,14 +5,14 @@
* Allows the creation of custom blocks through the user interface.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldInstanceConfig;
/**
* Implements hook_help().
*/
-function block_content_help($route_name, Request $request) {
+function block_content_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.block_content':
$output = '';
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index ad4b4d0adb7a..54aad063e3b8 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -9,17 +9,17 @@ use Drupal\book\BookManagerInterface;
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeInterface;
use Drupal\node\NodeTypeInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Template\Attribute;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function book_help($route_name, Request $request) {
+function book_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.book':
$output = '' . t('About') . '
';
diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module
index 5d358b3568d4..6f69efc32aa6 100644
--- a/core/modules/breakpoint/breakpoint.module
+++ b/core/modules/breakpoint/breakpoint.module
@@ -8,12 +8,12 @@
use Drupal\breakpoint\Entity\Breakpoint;
use Drupal\breakpoint\Entity\BreakpointGroup;
use Drupal\Core\Config\Entity\ConfigEntityStorage;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function breakpoint_help($route_name, Request $request) {
+function breakpoint_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.breakpoint':
$output = '';
diff --git a/core/modules/ckeditor/ckeditor.module b/core/modules/ckeditor/ckeditor.module
index eb646c953c5e..421da85c3f9d 100644
--- a/core/modules/ckeditor/ckeditor.module
+++ b/core/modules/ckeditor/ckeditor.module
@@ -5,13 +5,13 @@
* Provides integration with the CKEditor WYSIWYG editor.
*/
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\editor\Entity\Editor;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function ckeditor_help($route_name, Request $request) {
+function ckeditor_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.ckeditor':
$output = '';
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index 15dfaf40cbe7..8899d5a60ac6 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -8,12 +8,12 @@ use Drupal\Core\Asset\CssOptimizer;
use Drupal\Component\Utility\Bytes;
use Drupal\Component\Utility\Environment;
use Drupal\Component\Utility\String;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function color_help($route_name, Request $request) {
+function color_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.color':
$output = '' . t('About') . '
';
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 08e938db29b2..8930d76863ed 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -17,6 +17,7 @@ use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\entity\Entity\EntityViewDisplay;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
@@ -28,7 +29,6 @@ use Drupal\field\FieldConfigInterface;
use Drupal\file\FileInterface;
use Drupal\user\EntityOwnerInterface;
use Drupal\node\NodeInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Comments are displayed in a flat list - expanded.
@@ -79,7 +79,7 @@ define('COMMENT_NEW_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
/**
* Implements hook_help().
*/
-function comment_help($route_name, Request $request) {
+function comment_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.comment':
$output = '' . t('About') . '
';
diff --git a/core/modules/config/config.module b/core/modules/config/config.module
index 8819fdbeacbd..e22b71bc7499 100644
--- a/core/modules/config/config.module
+++ b/core/modules/config/config.module
@@ -5,12 +5,12 @@
* Allows site administrators to modify configuration.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function config_help($route_name, Request $request) {
+function config_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.config':
$output = '';
diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module
index f95373cb25b2..b1289312bdb0 100644
--- a/core/modules/config_translation/config_translation.module
+++ b/core/modules/config_translation/config_translation.module
@@ -7,13 +7,13 @@
use Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks;
use Drupal\Core\Entity\EntityInterface;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
/**
* Implements hook_help().
*/
-function config_translation_help($route_name, Request $request) {
+function config_translation_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.config_translation':
$output = '';
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index 812c6df218ff..340b5185010a 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -1,15 +1,16 @@
' . t('About') . '';
diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module
index 63331875bc82..25a4b0e58541 100644
--- a/core/modules/dblog/dblog.module
+++ b/core/modules/dblog/dblog.module
@@ -11,12 +11,12 @@
* @see watchdog()
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function dblog_help($route_name, Request $request) {
+function dblog_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.dblog':
$output = '';
diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module
index 8ff97c3a125f..5aa79298c452 100644
--- a/core/modules/editor/editor.module
+++ b/core/modules/editor/editor.module
@@ -8,17 +8,17 @@
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\editor\Entity\Editor;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Entity\EntityInterface;
use Drupal\filter\FilterFormatInterface;
use Drupal\filter\Plugin\FilterInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function editor_help($route_name, Request $request) {
+function editor_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.editor':
$output = '';
diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module
index deadbf8c641c..d3590a1fc756 100644
--- a/core/modules/entity/entity.module
+++ b/core/modules/entity/entity.module
@@ -9,12 +9,12 @@
*/
use Drupal\Core\Config\Entity\ConfigEntityStorage;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function entity_help($route_name, Request $request) {
+function entity_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.entity':
$output = '';
diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module
index 1fef018d08e0..48ffc927ea0a 100644
--- a/core/modules/entity_reference/entity_reference.module
+++ b/core/modules/entity_reference/entity_reference.module
@@ -10,15 +10,15 @@ use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldInstanceConfig;
use Drupal\field\FieldConfigInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function entity_reference_help($route_name, Request $request) {
+function entity_reference_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.entity_reference':
$output = '';
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index 4726101c2ccb..1cd297253007 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -9,7 +9,7 @@ use Drupal\Component\Utility\Xss;
use Drupal\Core\Config\ConfigImporter;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Extension\Extension;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/*
* Load all public Field API functions. Drupal currently has no
@@ -59,7 +59,7 @@ require_once __DIR__ . '/field.purge.inc';
/**
* Implements hook_help().
*/
-function field_help($route_name, Request $request) {
+function field_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.field':
$output = '';
diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module
index 84078a242872..1dbee70c449c 100644
--- a/core/modules/field_ui/field_ui.module
+++ b/core/modules/field_ui/field_ui.module
@@ -7,15 +7,15 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\entity\EntityViewModeInterface;
use Drupal\field_ui\FieldUI;
use Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function field_ui_help($route_name, Request $request) {
+function field_ui_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.field_ui':
$output = '';
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 3b3764dd7686..7256399db520 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -8,13 +8,13 @@
use Drupal\Component\Utility\String;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\file\Entity\File;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Template\Attribute;
use Drupal\file\FileUsage\FileUsageInterface;
-use Symfony\Component\HttpFoundation\Request;
// Load all Field module hooks for File.
require_once __DIR__ . '/file.field.inc';
@@ -22,7 +22,7 @@ require_once __DIR__ . '/file.field.inc';
/**
* Implements hook_help().
*/
-function file_help($route_name, Request $request) {
+function file_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.file':
$output = '';
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 5e8fcbf11460..126ba0dffb9c 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -12,16 +12,16 @@ use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Template\Attribute;
use Drupal\filter\FilterFormatInterface;
use Drupal\filter\Plugin\FilterInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function filter_help($route_name, Request $request) {
+function filter_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.filter':
$output = '';
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 941c112d9f65..b0e9763e78dd 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -10,12 +10,12 @@ use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Component\Utility\String;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function forum_help($route_name, Request $request) {
+function forum_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.forum':
$output = '';
diff --git a/core/modules/hal/hal.module b/core/modules/hal/hal.module
index 0f026e5af710..a6c915ede040 100644
--- a/core/modules/hal/hal.module
+++ b/core/modules/hal/hal.module
@@ -5,12 +5,12 @@
* Adds support for serializing entities to Hypertext Application Language.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function hal_help($route_name, Request $request) {
+function hal_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.hal':
$output = '';
diff --git a/core/modules/help/help.module b/core/modules/help/help.module
index faf0f79ffa05..35396604055f 100644
--- a/core/modules/help/help.module
+++ b/core/modules/help/help.module
@@ -5,12 +5,12 @@
* Manages displaying online help.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function help_help($route_name, Request $request) {
+function help_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.main':
$output = '' . t('Getting Started') . '
';
diff --git a/core/modules/help/src/Controller/HelpController.php b/core/modules/help/src/Controller/HelpController.php
index f9389bf950fa..26a3160b623e 100644
--- a/core/modules/help/src/Controller/HelpController.php
+++ b/core/modules/help/src/Controller/HelpController.php
@@ -8,7 +8,8 @@
namespace Drupal\help\Controller;
use Drupal\Core\Controller\ControllerBase;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\Component\Utility\String;
@@ -18,20 +19,43 @@ use Drupal\Component\Utility\String;
class HelpController extends ControllerBase {
/**
- * Prints a page listing a glossary of Drupal terminology.
+ * The current route match.
*
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The current request.
+ * @var \Drupal\Core\Routing\RouteMatchInterface
+ */
+ protected $routeMatch;
+
+ /**
+ * Creates a new HelpController.
+ *
+ * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
+ * The current route match.
+ */
+ public function __construct(RouteMatchInterface $route_match) {
+ $this->routeMatch = $route_match;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function create(ContainerInterface $container) {
+ return new static(
+ $container->get('current_route_match')
+ );
+ }
+
+ /**
+ * Prints a page listing a glossary of Drupal terminology.
*
* @return string
* An HTML string representing the contents of help page.
*/
- public function helpMain(Request $request) {
+ public function helpMain() {
$output = array(
'#attached' => array(
'css' => array(drupal_get_path('module', 'help') . '/css/help.module.css'),
),
- '#markup' => '' . $this->t('Help topics') . '
' . $this->t('Help is available on the following items:') . '
' . $this->helpLinksAsList($request),
+ '#markup' => '' . $this->t('Help topics') . '
' . $this->t('Help is available on the following items:') . '
' . $this->helpLinksAsList(),
);
return $output;
}
@@ -39,18 +63,15 @@ class HelpController extends ControllerBase {
/**
* Provides a formatted list of available help topics.
*
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The current request.
- *
* @return string
* A string containing the formatted list.
*/
- protected function helpLinksAsList(Request $request) {
+ protected function helpLinksAsList() {
$module_info = system_rebuild_module_data();
$modules = array();
foreach ($this->moduleHandler()->getImplementations('help') as $module) {
- if ($this->moduleHandler()->invoke($module, 'help', array("help.page.$module", $request))) {
+ if ($this->moduleHandler()->invoke($module, 'help', array("help.page.$module", $this->routeMatch))) {
$modules[$module] = $module_info[$module]->info['name'];
}
}
@@ -78,21 +99,19 @@ class HelpController extends ControllerBase {
*
* @param string $name
* A module name to display a help page for.
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The current request.
*
* @return array
* A render array as expected by drupal_render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
- public function helpPage($name, Request $request) {
+ public function helpPage($name) {
$build = array();
if ($this->moduleHandler()->implementsHook($name, 'help')) {
$info = system_get_info('module');
$build['#title'] = String::checkPlain($info[$name]['name']);
- $temp = $this->moduleHandler()->invoke($name, 'help', array("help.page.$name", $request));
+ $temp = $this->moduleHandler()->invoke($name, 'help', array("help.page.$name", $this->routeMatch));
if (empty($temp)) {
$build['top']['#markup'] = $this->t('No help is available for module %module.', array('%module' => $info[$name]['name']));
}
diff --git a/core/modules/history/history.module b/core/modules/history/history.module
index c019d9d60a46..4a2b2e3e4c5f 100644
--- a/core/modules/history/history.module
+++ b/core/modules/history/history.module
@@ -11,7 +11,7 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Entities changed before this time are always shown as read.
@@ -24,7 +24,7 @@ define('HISTORY_READ_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
/**
* Implements hook_help().
*/
-function history_help($route_name, Request $request) {
+function history_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.history':
$output = '' . t('About') . '
';
diff --git a/core/modules/image/image.module b/core/modules/image/image.module
index 07759288f341..406423628734 100644
--- a/core/modules/image/image.module
+++ b/core/modules/image/image.module
@@ -7,10 +7,10 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\file\Entity\File;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldInstanceConfigInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Image style constant for user presets in the database.
@@ -48,7 +48,7 @@ require_once __DIR__ . '/image.field.inc';
/**
* Implements hook_help().
*/
-function image_help($route_name, Request $request) {
+function image_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.image':
$output = '';
@@ -70,11 +70,11 @@ function image_help($route_name, Request $request) {
return '' . t('Image styles commonly provide thumbnail sizes by scaling and cropping images, but can also add various effects before an image is displayed. When an image is displayed with a style, a new file is created and the original image is left unchanged.') . '
';
case 'image.effect_add_form':
- $effect = \Drupal::service('plugin.manager.image.effect')->getDefinition($request->attributes->get('image_effect'));
+ $effect = \Drupal::service('plugin.manager.image.effect')->getDefinition($route_match->getParameter('image_effect'));
return isset($effect['description']) ? ('' . $effect['description'] . '
') : NULL;
case 'image.effect_edit_form':
- $effect = $request->attributes->get('image_style')->getEffect($request->attributes->get('image_effect'));
+ $effect = $route_match->getParameter('image_style')->getEffect($route_match->getParameter('image_effect'));
$effect_definition = $effect->getPluginDefinition();
return isset($effect_definition['description']) ? ('' . $effect_definition['description'] . '
') : NULL;
}
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 26e99ff9f00b..26f25290154f 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -7,6 +7,7 @@
use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\language\ConfigurableLanguageManager;
use Drupal\language\ConfigurableLanguageManagerInterface;
use Drupal\language\Entity\Language as LanguageEntity;
@@ -14,12 +15,11 @@ use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI;
use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrlFallback;
use Drupal\node\NodeTypeInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function language_help($route_name, Request $request) {
+function language_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.language':
$output = '';
@@ -73,13 +73,13 @@ function language_help($route_name, Request $request) {
return $output;
case 'block.admin_edit':
- if (($block = $request->attributes->get('block')) && $block->get('plugin') == 'language_block:language_interface') {
+ if (($block = $route_match->getParameter('block')) && $block->get('plugin') == 'language_block:language_interface') {
return '' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '
';
}
break;
case 'block.admin_add':
- if ($request->attributes->get('plugin_id') == 'language_block:language_interface') {
+ if ($route_match->getParameter('plugin_id') == 'language_block:language_interface') {
return '' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '
';
}
break;
diff --git a/core/modules/link/link.module b/core/modules/link/link.module
index a791a151e98d..d33181ec17df 100644
--- a/core/modules/link/link.module
+++ b/core/modules/link/link.module
@@ -6,12 +6,12 @@
*/
use Drupal\Component\Utility\String;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function link_help($route_name, Request $request) {
+function link_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.link':
$output = '';
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 179894b39812..ea0ec44be97a 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -15,11 +15,11 @@ use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\TranslationWrapper;
use Drupal\Core\Language\LanguageInterface;
use Drupal\language\Entity\Language as LanguageEntity;
use Drupal\Component\Utility\Crypt;
-use Symfony\Component\HttpFoundation\Request;
/**
* Regular expression pattern used to localize JavaScript strings.
@@ -137,7 +137,7 @@ const LOCALE_TRANSLATION_CURRENT = 'current';
/**
* Implements hook_help().
*/
-function locale_help($route_name, Request $request) {
+function locale_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.locale':
$output = '';
diff --git a/core/modules/menu_link/menu_link.module b/core/modules/menu_link/menu_link.module
index 23fc5541d97b..8a2ce38c26e4 100644
--- a/core/modules/menu_link/menu_link.module
+++ b/core/modules/menu_link/menu_link.module
@@ -9,9 +9,8 @@ use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\menu_link\Entity\MenuLink;
use Drupal\menu_link\MenuLinkInterface;
-use Symfony\Component\HttpFoundation\Request;
-function menu_link_help($route_name, Request $request) {
+function menu_link_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.menu_link':
$output = '';
diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module
index 3639d26c19f2..5e2f5bcf6e14 100644
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -14,13 +14,13 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\block\BlockPluginInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeTypeInterface;
use Drupal\system\Entity\Menu;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\menu_link\Entity\MenuLink;
use Drupal\menu_link\MenuLinkStorage;
use Drupal\node\NodeInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Maximum length of menu name as entered by the user. Database length is 32
@@ -31,7 +31,7 @@ const MENU_MAX_MENU_NAME_LENGTH_UI = 27;
/**
* Implements hook_help().
*/
-function menu_ui_help($route_name, Request $request) {
+function menu_ui_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.menu_ui':
$output = '';
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 28c826fc077e..7294dcc964e6 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -11,8 +11,8 @@
use Drupal\Component\Utility\Xss;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
-use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Database\Query\SelectInterface;
@@ -88,7 +88,7 @@ const NODE_ACCESS_IGNORE = NULL;
/**
* Implements hook_help().
*/
-function node_help($route_name, Request $request) {
+function node_help($route_name, RouteMatchInterface $route_match) {
// Remind site administrators about the {node_access} table being flagged
// for rebuild. We don't need to issue the message on the confirm form, or
// while the rebuild is being processed.
@@ -128,12 +128,12 @@ function node_help($route_name, Request $request) {
case 'field_ui.form_display_overview_node':
case 'field_ui.form_display_overview_form_mode_node':
- $type = $request->attributes->get('node_type');
+ $type = $route_match->getParameter('node_type');
return '' . t('Content items can be edited using different form modes. Here, you can define which fields are shown and hidden when %type content is edited in each form mode, and define how the field form widgets are displayed in each form mode.', array('%type' => $type->label())) . '
' ;
case 'field_ui.display_overview_node':
case 'field_ui.display_overview_view_mode_node':
- $type = $request->attributes->get('node_type');
+ $type = $route_match->getParameter('node_type');
return '' . t('Content items can be displayed using different view modes: Teaser, Full content, Print, RSS, etc. Teaser is a short format that is typically used in lists of multiple content items. Full content is typically used when the content is displayed on its own page.') . '
' .
'' . t('Here, you can define which fields are shown and hidden when %type content is displayed in each view mode, and define how the fields are displayed in each view mode.', array('%type' => $type->label())) . '
';
@@ -141,12 +141,12 @@ function node_help($route_name, Request $request) {
return '' . t('Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.') . '
';
case 'node.page_edit':
- $node = $request->attributes->get('node');
+ $node = $route_match->getParameter('node');
$type = $node->getType();
return (!empty($type->help) ? Xss::filterAdmin($type->help) : '');
case 'node.add':
- $type = $request->attributes->get('node_type');
+ $type = $route_match->getParameter('node_type');
return (!empty($type->help) ? Xss::filterAdmin($type->help) : '');
}
}
diff --git a/core/modules/options/options.module b/core/modules/options/options.module
index 71bbf33b2912..e149477198b1 100644
--- a/core/modules/options/options.module
+++ b/core/modules/options/options.module
@@ -7,14 +7,14 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldConfigUpdateForbiddenException;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function options_help($route_name, Request $request) {
+function options_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.options':
$output = '';
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 50ba145224a1..d2c9d584f080 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -9,12 +9,12 @@ use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Field\FieldDefinition;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function path_help($route_name, Request $request) {
+function path_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.path':
$output = '';
diff --git a/core/modules/quickedit/quickedit.module b/core/modules/quickedit/quickedit.module
index a10fc3ac260e..f02fe3de5587 100644
--- a/core/modules/quickedit/quickedit.module
+++ b/core/modules/quickedit/quickedit.module
@@ -13,12 +13,12 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function quickedit_help($route_name, Request $request) {
+function quickedit_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.quickedit':
$output = '' . t('About') . '
';
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index e300e80f8251..e55510b15726 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -6,13 +6,13 @@
*/
use Drupal\Component\Utility\String;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function rdf_help($route_name, Request $request) {
+function rdf_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.rdf':
$output = '';
diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module
index 53c182c01001..36972c498037 100644
--- a/core/modules/responsive_image/responsive_image.module
+++ b/core/modules/responsive_image/responsive_image.module
@@ -6,13 +6,13 @@
*/
use Drupal\breakpoint\Entity\Breakpoint;
+use Drupal\Core\Routing\RouteMatchInterface;
use \Drupal\Core\Template\Attribute;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function responsive_image_help($route_name, Request $request) {
+function responsive_image_help($route_name, RouteMatchInterface $route_match) {
$output = '';
switch ($route_name) {
case 'help.page.responsive_image':
diff --git a/core/modules/rest/rest.module b/core/modules/rest/rest.module
index a3cf32b5d0d2..285dfb27a1f5 100644
--- a/core/modules/rest/rest.module
+++ b/core/modules/rest/rest.module
@@ -5,7 +5,7 @@
* RESTful web services module.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_permission().
@@ -26,7 +26,7 @@ function rest_permission() {
/**
* Implements hook_help().
*/
-function rest_help($route_name, Request $request) {
+function rest_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.rest':
$output = '';
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index a59dcc2dff7e..b7c4ef135eac 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -7,7 +7,7 @@
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Matches all 'N' Unicode character classes (numbers)
@@ -67,7 +67,7 @@ define('PREG_CLASS_CJK', '\x{1100}-\x{11FF}\x{3040}-\x{309F}\x{30A1}-\x{318E}' .
/**
* Implements hook_help().
*/
-function search_help($route_name, Request $request) {
+function search_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.search':
$output = '';
diff --git a/core/modules/serialization/serialization.module b/core/modules/serialization/serialization.module
index 5169f93d0337..a6693aa633f3 100644
--- a/core/modules/serialization/serialization.module
+++ b/core/modules/serialization/serialization.module
@@ -5,12 +5,12 @@
* Provides a service for (de)serializing data to/from formats such as JSON and XML.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function serialization_help($route_name, Request $request) {
+function serialization_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.serialization':
$output = '';
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index 6b516d1b889d..e433c82617c2 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -7,16 +7,16 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Routing\UrlMatcher;
use Drupal\Core\Url;
use Drupal\shortcut\Entity\ShortcutSet;
use Drupal\shortcut\ShortcutSetInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function shortcut_help($route_name, Request $request) {
+function shortcut_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.shortcut':
$output = '' . t('About') . '
';
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 96ab21bb81b4..8cc079f9ad40 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -4,8 +4,8 @@ use Drupal\Core\Database\Database;
use Drupal\Core\Page\HtmlPage;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\simpletest\TestBase;
-use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Process\PhpExecutableFinder;
/**
@@ -16,7 +16,7 @@ use Symfony\Component\Process\PhpExecutableFinder;
/**
* Implements hook_help().
*/
-function simpletest_help($route_name, Request $request) {
+function simpletest_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.simpletest':
$output = '';
diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index 3b40cea4b98f..bce72c749e93 100644
--- a/core/modules/statistics/statistics.module
+++ b/core/modules/statistics/statistics.module
@@ -7,13 +7,13 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function statistics_help($route_name, Request $request) {
+function statistics_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.statistics':
$output = '';
diff --git a/core/modules/syslog/syslog.module b/core/modules/syslog/syslog.module
index aff3d5680801..4165fab68030 100644
--- a/core/modules/syslog/syslog.module
+++ b/core/modules/syslog/syslog.module
@@ -5,12 +5,12 @@
* Redirects logging messages to syslog.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function syslog_help($route_name, Request $request) {
+function syslog_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.syslog':
$output = '';
diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php
index f993c79aff53..b58cab83efe0 100644
--- a/core/modules/system/src/Form/ModulesListForm.php
+++ b/core/modules/system/src/Form/ModulesListForm.php
@@ -17,6 +17,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Access\AccessManager;
@@ -66,6 +67,13 @@ class ModulesListForm extends FormBase {
*/
protected $queryFactory;
+ /**
+ * The current route match.
+ *
+ * @var \Drupal\Core\Routing\RouteMatchInterface
+ */
+ protected $routeMatch;
+
/**
* {@inheritdoc}
*/
@@ -76,7 +84,8 @@ class ModulesListForm extends FormBase {
$container->get('access_manager'),
$container->get('entity.manager'),
$container->get('entity.query'),
- $container->get('current_user')
+ $container->get('current_user'),
+ $container->get('current_route_match')
);
}
@@ -95,14 +104,17 @@ class ModulesListForm extends FormBase {
* The entity query factory.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
+ * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
+ * The current route match.
*/
- public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager, EntityManagerInterface $entity_manager, QueryFactory $query_factory, AccountInterface $current_user) {
+ public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager, EntityManagerInterface $entity_manager, QueryFactory $query_factory, AccountInterface $current_user, RouteMatchInterface $route_match) {
$this->moduleHandler = $module_handler;
$this->keyValueExpirable = $key_value_expirable;
$this->accessManager = $access_manager;
$this->entityManager = $entity_manager;
$this->queryFactory = $query_factory;
$this->currentUser = $current_user;
+ $this->routeMatch = $route_match;
}
/**
@@ -211,7 +223,7 @@ class ModulesListForm extends FormBase {
// Generate link for module's help page, if there is one.
$row['links']['help'] = array();
if ($this->moduleHandler->moduleExists('help') && $module->status && in_array($module->getName(), $this->moduleHandler->getImplementations('help'))) {
- if ($this->moduleHandler->invoke($module->getName(), 'help', array('help.page.' . $module->getName(), $this->getRequest()))) {
+ if ($this->moduleHandler->invoke($module->getName(), 'help', array('help.page.' . $module->getName(), $this->routeMatch))) {
$row['links']['help'] = array(
'#type' => 'link',
'#title' => $this->t('Help'),
diff --git a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php b/core/modules/system/src/Plugin/Block/SystemHelpBlock.php
index e99787c9626e..c9de38173701 100644
--- a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php
+++ b/core/modules/system/src/Plugin/Block/SystemHelpBlock.php
@@ -10,8 +10,8 @@ namespace Drupal\system\Plugin\Block;
use Drupal\block\BlockBase;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
-use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -46,6 +46,13 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
*/
protected $request;
+ /**
+ * The current route match.
+ *
+ * @var \Drupal\Core\Routing\RouteMatchInterface
+ */
+ protected $routeMatch;
+
/**
* Creates a SystemHelpBlock instance.
*
@@ -59,12 +66,15 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
* The current request.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
+ * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
+ * The current route match.
*/
- public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request, ModuleHandlerInterface $module_handler) {
+ public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request, ModuleHandlerInterface $module_handler, RouteMatchInterface $route_match) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->request = $request;
$this->moduleHandler = $module_handler;
+ $this->routeMatch = $route_match;
}
/**
@@ -72,7 +82,13 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
- $configuration, $plugin_id, $plugin_definition, $container->get('request'), $container->get('module_handler'));
+ $configuration,
+ $plugin_id,
+ $plugin_definition,
+ $container->get('request'),
+ $container->get('module_handler'),
+ $container->get('current_route_match')
+ );
}
/**
@@ -95,8 +111,7 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
return '';
}
- $route_name = $request->attributes->get(RouteObjectInterface::ROUTE_NAME);
- $help = $this->moduleHandler->invokeAll('help', array($route_name, $request));
+ $help = $this->moduleHandler->invokeAll('help', array($this->routeMatch->getRouteName(), $this->routeMatch));
return $help ? implode("\n", $help) : '';
}
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 09663aad3261..2eef874a399d 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -1005,14 +1005,14 @@ function hook_permission() {
* For page-specific help, use the route name as identified in the
* module's routing.yml file. For module overview help, the route name
* will be in the form of "help.page.$modulename".
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The current request. This can be used to generate different help
+ * @param Drupal\Core\Routing\RouteMatchInterface $route_match
+ * The current route match. This can be used to generate different help
* output for different pages that share the same route.
*
* @return string
* A localized string containing the help text.
*/
-function hook_help($route_name, \Symfony\Component\HttpFoundation\Request $request) {
+function hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the block module.
case 'help.page.block':
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index c96de7997dfc..3d67b659e5bf 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -8,13 +8,13 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionDiscovery;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\TranslationWrapper;
use Drupal\Core\Language\LanguageInterface;
use Drupal\block\BlockPluginInterface;
use Drupal\user\UserInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use GuzzleHttp\Exception\RequestException;
-use Symfony\Component\HttpFoundation\Request;
/**
* New users will be set to the default time zone at registration.
@@ -75,7 +75,7 @@ const EMAIL_MAX_LENGTH = 254;
/**
* Implements hook_help().
*/
-function system_help($route_name, Request $request) {
+function system_help($route_name, RouteMatchInterface $route_match) {
global $base_url;
switch ($route_name) {
@@ -109,7 +109,7 @@ function system_help($route_name, Request $request) {
case 'system.theme_settings_theme':
$theme_list = list_themes();
- $theme = $theme_list[$request->attributes->get('theme')];
+ $theme = $theme_list[$route_match->getParameter('theme')];
return '' . t('These options control the display settings for the %name theme. When your site is displayed using this theme, these settings will be used.', array('%name' => $theme->info['name'])) . '
';
case 'system.theme_settings':
@@ -134,13 +134,13 @@ function system_help($route_name, Request $request) {
return '' . t('The uninstall process removes all data related to a module.') . '
';
case 'block.admin_edit':
- if (($block = $request->attributes->get('block')) && $block->get('plugin') == 'system_powered_by_block') {
+ if (($block = $route_match->getParameter('block')) && $block->get('plugin') == 'system_powered_by_block') {
return '' . t('The Powered by Drupal block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '
';
}
break;
case 'block.admin_add':
- if ($request->attributes->get('plugin_id') == 'system_powered_by_block') {
+ if ($route_match->getParameter('plugin_id') == 'system_powered_by_block') {
return '' . t('The Powered by Drupal block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '
';
}
break;
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index cf9a6abde1a4..0d9d7370cefb 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -9,6 +9,7 @@ use Drupal\Component\Utility\Tags;
use Drupal\Core\Entity\ContentEntityDatabaseStorage;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\file\FileInterface;
use Drupal\node\Entity\Node;
@@ -16,7 +17,6 @@ use Drupal\taxonomy\Entity\Term;
use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\taxonomy\VocabularyInterface;
use Drupal\Component\Utility\String;
-use Symfony\Component\HttpFoundation\Request;
/**
* Denotes that no term in the vocabulary has a parent.
@@ -44,7 +44,7 @@ const TAXONOMY_HIERARCHY_MULTIPLE = 2;
/**
* Implements hook_help().
*/
-function taxonomy_help($route_name, Request $request) {
+function taxonomy_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.taxonomy':
$output = '';
@@ -79,7 +79,7 @@ function taxonomy_help($route_name, Request $request) {
return $output;
case 'taxonomy.overview_terms':
- $vocabulary = $request->attributes->get('taxonomy_vocabulary');
+ $vocabulary = $route_match->getParameter('taxonomy_vocabulary');
switch ($vocabulary->hierarchy) {
case TAXONOMY_HIERARCHY_DISABLED:
return '' . t('You can reorganize the terms in %capital_name using their drag-and-drop handles, and group terms under a parent term by sliding them under and to the right of the parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '
';
diff --git a/core/modules/telephone/telephone.module b/core/modules/telephone/telephone.module
index f7dbc4ecd30e..6c5d524633d2 100644
--- a/core/modules/telephone/telephone.module
+++ b/core/modules/telephone/telephone.module
@@ -5,12 +5,12 @@
* Defines a simple telephone number field type.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function telephone_help($route_name, Request $request) {
+function telephone_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.telephone':
$output = '';
diff --git a/core/modules/text/text.module b/core/modules/text/text.module
index 623f14bb0a7c..161248726f64 100644
--- a/core/modules/text/text.module
+++ b/core/modules/text/text.module
@@ -7,12 +7,12 @@
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityInterface;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function text_help($route_name, Request $request) {
+function text_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.text':
$output = '';
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 0c94f59acf17..f427f8407f68 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -8,9 +8,9 @@
use Drupal\Component\Utility\String;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute;
use Drupal\Component\Utility\Crypt;
-use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\menu_link\MenuLinkInterface;
use Drupal\user\RoleInterface;
@@ -19,7 +19,7 @@ use Drupal\user\UserInterface;
/**
* Implements hook_help().
*/
-function toolbar_help($route_name, Request $request) {
+function toolbar_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.toolbar':
$output = '' . t('About') . '
';
diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module
index f6774fdf6c9a..17001e8d34d4 100644
--- a/core/modules/tour/tour.module
+++ b/core/modules/tour/tour.module
@@ -4,13 +4,14 @@
* @file
* Main functions of the module.
*/
+
use Drupal\Core\Cache\CacheBackendInterface;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function tour_help($route_name, Request $request) {
+function tour_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.tour':
$output = '';
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index b786a676c155..91956000b701 100644
--- a/core/modules/tracker/tracker.module
+++ b/core/modules/tracker/tracker.module
@@ -7,14 +7,14 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\comment\CommentInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeInterface;
use Drupal\Core\Session\AccountInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function tracker_help($route_name, Request $request) {
+function tracker_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.tracker':
$output = '' . t('About') . '
';
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index afd16a96323f..967cc8b0748c 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -11,9 +11,9 @@
* ability to install contributed modules and themes via an user interface.
*/
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Site\Settings;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
-use Symfony\Component\HttpFoundation\Request;
// These are internally used constants for this code, do not modify.
@@ -65,7 +65,7 @@ const UPDATE_FETCH_PENDING = -4;
/**
* Implements hook_help().
*/
-function update_help($route_name, Request $request) {
+function update_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.update':
$output = '';
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 8ee4265411ca..86b1fa710ca8 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -4,6 +4,7 @@ use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AnonymousUserSession;
use \Drupal\Core\Entity\Display\EntityViewDisplayInterface;
@@ -16,7 +17,6 @@ use Drupal\user\RoleInterface;
use Drupal\Core\Template\Attribute;
use Drupal\Core\TypedData\DataDefinition;
use Symfony\Component\HttpFoundation\RedirectResponse;
-use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\menu_link\Entity\MenuLink;
@@ -49,7 +49,7 @@ const USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = 'visitors_admin_approval'
/**
* Implement hook_help().
*/
-function user_help($route_name, Request $request) {
+function user_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.user':
$output = '';
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index bc1ff0c20cba..4dfa5e823ba6 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -14,6 +14,7 @@ use Drupal\Core\Cache\Cache;
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Render\Element;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\Plugin\Derivative\ViewsLocalTask;
use Drupal\Core\Template\AttributeArray;
use Drupal\views\ViewExecutable;
@@ -21,12 +22,11 @@ use Drupal\Component\Plugin\Exception\PluginException;
use Drupal\views\Entity\View;
use Drupal\views\Views;
use Drupal\field\FieldInstanceConfigInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function views_help($route_name, Request $request) {
+function views_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.views':
$output = '';
diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module
index 6b36cb5b5115..9e0d08d7fc23 100644
--- a/core/modules/views_ui/views_ui.module
+++ b/core/modules/views_ui/views_ui.module
@@ -5,6 +5,7 @@
* Provide structure for the administrative interface to Views.
*/
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\Views;
use Drupal\views\ViewExecutable;
use Drupal\views\ViewStorageInterface;
@@ -12,12 +13,11 @@ use Drupal\views_ui\ViewUI;
use Drupal\views\Analyzer;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function views_ui_help($route_name, Request $request) {
+function views_ui_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.views_ui':
$output = '';
diff --git a/core/modules/xmlrpc/xmlrpc.module b/core/modules/xmlrpc/xmlrpc.module
index bc82806d3e63..a4c87e289ed6 100644
--- a/core/modules/xmlrpc/xmlrpc.module
+++ b/core/modules/xmlrpc/xmlrpc.module
@@ -5,12 +5,12 @@
* Enables XML-RPC functionality.
*/
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
-function xmlrpc_help($route_name, Request $request) {
+function xmlrpc_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.xmlrpc':
$output = '';