summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-06-30 03:33:08 (GMT)
committerwebchick2014-06-30 03:33:08 (GMT)
commit94e0188a106faa403ba17b415c13f1a49759a511 (patch)
tree8dec8f1e85c949d7bf611a81a8db064073ee87f3
parenta36a116d75d9ea971c45ca51427982e1a184e0f8 (diff)
Issue #2294129 by xjm, tim.plunkett: Switch hook_help() to use RouteMatch instead of Request.
-rw-r--r--core/modules/action/action.module4
-rw-r--r--core/modules/aggregator/aggregator.module4
-rw-r--r--core/modules/ban/ban.module4
-rw-r--r--core/modules/basic_auth/basic_auth.module4
-rw-r--r--core/modules/block/block.module6
-rw-r--r--core/modules/block_content/block_content.module4
-rw-r--r--core/modules/book/book.module4
-rw-r--r--core/modules/breakpoint/breakpoint.module4
-rw-r--r--core/modules/ckeditor/ckeditor.module4
-rw-r--r--core/modules/color/color.module4
-rw-r--r--core/modules/comment/comment.module4
-rw-r--r--core/modules/config/config.module4
-rw-r--r--core/modules/config_translation/config_translation.module4
-rw-r--r--core/modules/contact/contact.module5
-rw-r--r--core/modules/content_translation/content_translation.module4
-rw-r--r--core/modules/contextual/contextual.module4
-rw-r--r--core/modules/datetime/datetime.module5
-rw-r--r--core/modules/dblog/dblog.module4
-rw-r--r--core/modules/editor/editor.module4
-rw-r--r--core/modules/entity/entity.module4
-rw-r--r--core/modules/entity_reference/entity_reference.module4
-rw-r--r--core/modules/field/field.module4
-rw-r--r--core/modules/field_ui/field_ui.module4
-rw-r--r--core/modules/file/file.module4
-rw-r--r--core/modules/filter/filter.module4
-rw-r--r--core/modules/forum/forum.module4
-rw-r--r--core/modules/hal/hal.module4
-rw-r--r--core/modules/help/help.module4
-rw-r--r--core/modules/help/src/Controller/HelpController.php49
-rw-r--r--core/modules/history/history.module4
-rw-r--r--core/modules/image/image.module8
-rw-r--r--core/modules/language/language.module8
-rw-r--r--core/modules/link/link.module4
-rw-r--r--core/modules/locale/locale.module4
-rw-r--r--core/modules/menu_link/menu_link.module3
-rw-r--r--core/modules/menu_ui/menu_ui.module4
-rw-r--r--core/modules/node/node.module12
-rw-r--r--core/modules/options/options.module4
-rw-r--r--core/modules/path/path.module4
-rw-r--r--core/modules/quickedit/quickedit.module4
-rw-r--r--core/modules/rdf/rdf.module4
-rw-r--r--core/modules/responsive_image/responsive_image.module4
-rw-r--r--core/modules/rest/rest.module4
-rw-r--r--core/modules/search/search.module4
-rw-r--r--core/modules/serialization/serialization.module4
-rw-r--r--core/modules/shortcut/shortcut.module4
-rw-r--r--core/modules/simpletest/simpletest.module4
-rw-r--r--core/modules/statistics/statistics.module4
-rw-r--r--core/modules/syslog/syslog.module4
-rw-r--r--core/modules/system/src/Form/ModulesListForm.php18
-rw-r--r--core/modules/system/src/Plugin/Block/SystemHelpBlock.php25
-rw-r--r--core/modules/system/system.api.php6
-rw-r--r--core/modules/system/system.module10
-rw-r--r--core/modules/taxonomy/taxonomy.module6
-rw-r--r--core/modules/telephone/telephone.module4
-rw-r--r--core/modules/text/text.module4
-rw-r--r--core/modules/toolbar/toolbar.module4
-rw-r--r--core/modules/tour/tour.module5
-rw-r--r--core/modules/tracker/tracker.module4
-rw-r--r--core/modules/update/update.module4
-rw-r--r--core/modules/user/user.module4
-rw-r--r--core/modules/views/views.module4
-rw-r--r--core/modules/views_ui/views_ui.module4
-rw-r--r--core/modules/xmlrpc/xmlrpc.module4
64 files changed, 207 insertions, 159 deletions
diff --git a/core/modules/action/action.module b/core/modules/action/action.module
index 35a91b2..8e11de1 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 80edea9..64eb275 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 f36a265..2d048d4 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 f8fd225..9c09ce2 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 69030df..4681b8a 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 = '<p>' . 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 <em>Place blocks</em>. 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 <em>Save blocks</em> button at the bottom of the page.') . '</p>';
$output .= '<p>' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module
index 96ff041..706fa69 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 ad4b4d0..54aad06 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module
index 5d358b3..6f69efc 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 eb646c9..421da85 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 15dfaf4..8899d5a 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 08e938d..8930d76 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/config/config.module b/core/modules/config/config.module
index 8819fdb..e22b71b 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 f95373c..b128931 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 812c6df..340b518 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -1,15 +1,16 @@
<?php
-use Symfony\Component\HttpFoundation\Request;
/**
* @file
* Enables the use of personal and site-wide contact forms.
*/
+use Drupal\Core\Routing\RouteMatchInterface;
+
/**
* Implements hook_help().
*/
-function contact_help($route_name, Request $request) {
+function contact_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.contact':
$output = '';
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index 8273831..0d22898 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -10,15 +10,15 @@ use Drupal\Core\Entity\EntityFormInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\Entity\FieldInstanceConfig;
use Drupal\field\FieldInstanceConfigInterface;
use Drupal\node\NodeInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function content_translation_help($route_name, Request $request) {
+function content_translation_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.content_translation':
$output = '';
diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module
index a04792f..2f69521 100644
--- a/core/modules/contextual/contextual.module
+++ b/core/modules/contextual/contextual.module
@@ -7,8 +7,8 @@
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute;
-use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_toolbar().
@@ -64,7 +64,7 @@ function contextual_page_build(&$page) {
/**
* Implements hook_help().
*/
-function contextual_help($route_name, Request $request) {
+function contextual_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.contextual':
$output = '';
diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index 31150bb..b5f98dd 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -7,6 +7,7 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute;
use Drupal\datetime\DateHelper;
use Drupal\node\NodeInterface;
@@ -29,8 +30,8 @@ const DATETIME_DATE_STORAGE_FORMAT = 'Y-m-d';
/**
* Implements hook_help().
*/
-function datetime_help($path, $arg) {
- switch ($path) {
+function datetime_help($route_name, RouteMatchInterface $route_match) {
+ switch ($route_name) {
case 'help.page.datetime':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module
index 6333187..25a4b0e 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 8ff97c3..5aa7929 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 deadbf8..d3590a1 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 1fef018..48ffc92 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 4726101..1cd2972 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 84078a24..1dbee70 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 3b3764d..7256399 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 5e8fcbf..126ba0d 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 941c112..b0e9763 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 0f026e5..a6c915e 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 faf0f79..3539660 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 = '<h2>' . t('Getting Started') . '</h2>';
diff --git a/core/modules/help/src/Controller/HelpController.php b/core/modules/help/src/Controller/HelpController.php
index f9389bf..26a3160 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.
+ *
+ * @var \Drupal\Core\Routing\RouteMatchInterface
+ */
+ protected $routeMatch;
+
+ /**
+ * Creates a new HelpController.
*
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The current request.
+ * @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' => '<h2>' . $this->t('Help topics') . '</h2><p>' . $this->t('Help is available on the following items:') . '</p>' . $this->helpLinksAsList($request),
+ '#markup' => '<h2>' . $this->t('Help topics') . '</h2><p>' . $this->t('Help is available on the following items:') . '</p>' . $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 c019d9d..4a2b2e3 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/image/image.module b/core/modules/image/image.module
index 0775928..4064236 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 '<p>' . 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.') . '</p>';
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']) ? ('<p>' . $effect['description'] . '</p>') : 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']) ? ('<p>' . $effect_definition['description'] . '</p>') : NULL;
}
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 26e99ff..26f2529 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 '<p>' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '</p>';
}
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 '<p>' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '</p>';
}
break;
diff --git a/core/modules/link/link.module b/core/modules/link/link.module
index a791a15..d33181e 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 179894b..ea0ec44 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 23fc554..8a2ce38 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 3639d26..5e2f5bc 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 28c826f..7294dcc 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 '<p>' . 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())) . '</p>' ;
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 '<p>' . t('Content items can be displayed using different view modes: Teaser, Full content, Print, RSS, etc. <em>Teaser</em> is a short format that is typically used in lists of multiple content items. <em>Full content</em> is typically used when the content is displayed on its own page.') . '</p>' .
'<p>' . 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())) . '</p>';
@@ -141,12 +141,12 @@ function node_help($route_name, Request $request) {
return '<p>' . t('Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.') . '</p>';
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 71bbf33..e149477 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 50ba145..d2c9d58 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 a10fc3a..f02fe3d 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index e300e80..e55510b 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 53c182c..36972c4 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 a3cf32b..285dfb2 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 a59dcc2..b7c4ef1 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 5169f93..a6693aa 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 6b516d1..e433c82 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 96ab21b..8cc079f 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 3b40cea..bce72c7 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 aff3d56..4165fab 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 f993c79..b58cab8 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;
@@ -67,6 +68,13 @@ class ModulesListForm extends FormBase {
protected $queryFactory;
/**
+ * The current route match.
+ *
+ * @var \Drupal\Core\Routing\RouteMatchInterface
+ */
+ protected $routeMatch;
+
+ /**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
@@ -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 e99787c..c9de381 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;
@@ -47,6 +47,13 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
protected $request;
/**
+ * The current route match.
+ *
+ * @var \Drupal\Core\Routing\RouteMatchInterface
+ */
+ protected $routeMatch;
+
+ /**
* Creates a SystemHelpBlock instance.
*
* @param array $configuration
@@ -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 09663aa..2eef874 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 c96de79..3d67b65 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 '<p>' . 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'])) . '</p>';
case 'system.theme_settings':
@@ -134,13 +134,13 @@ function system_help($route_name, Request $request) {
return '<p>' . t('The uninstall process removes all data related to a module.') . '</p>';
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 '<p>' . t('The <em>Powered by Drupal</em> 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.') . '</p>';
}
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 '<p>' . t('The <em>Powered by Drupal</em> 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.') . '</p>';
}
break;
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index cf9a6ab..0d9d737 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 '<p>' . 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)) . '</p>';
diff --git a/core/modules/telephone/telephone.module b/core/modules/telephone/telephone.module
index f7dbc4e..6c5d524 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 623f14b..1612487 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 0c94f59..f427f84 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module
index f6774fd..17001e8 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 b786a67..9195600 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 = '<h3>' . t('About') . '</h3>';
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index afd16a9..967cc8b 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 8ee4265..86b1fa7 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 bc1ff0c..4dfa5e8 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 6b36cb5..9e0d08d 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 bc82806..a4c87e2 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 = '';