diff --git a/core/modules/help/config/install/help.topic.help.yml b/core/modules/help/config/install/help.topic.help.yml index 7f2b161..83a06f8 100644 --- a/core/modules/help/config/install/help.topic.help.yml +++ b/core/modules/help/config/install/help.topic.help.yml @@ -4,7 +4,7 @@ dependencies: { } id: help label: 'Help module' body: - value: "

About

\r\n\r\n

The Help module provides Help reference pages to guide you through the use and configuration of modules. It is a starting point for Drupal.org online documentation pages that contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online documentation for the Help module.

\r\n\r\n

Uses

\r\n\r\n
\r\n\t
Providing a help reference
\r\n\t
The Help module displays both static module-provided help and configured help topics on the main Help page.
\r\n\t
Configuring help topics
\r\n\t
You can add, edit, delete, and translate configured help topics on the Help topics administration page. The help topics that are listed in the Module help section of the main Help page cannot be edited or deleted.
\r\n
\r\n" + value: "

About

\r\n\r\n

The Help module provides Help reference pages to guide you through the use and configuration of modules. It is a starting point for Drupal.org online documentation pages that contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online documentation for the Help module.

\r\n\r\n

Uses

\r\n\r\n
\r\n\t
Providing a help reference
\r\n\t
The Help module displays both static module-provided help and configured help topics on the main Help page.
\r\n\t
Configuring help topics
\r\n\t
You can add, edit, delete, and translate configured help topics on the Help topics administration page. The help topics that are listed in the Module help section of the main Help page cannot be edited or deleted.
\r\n
\r\n" format: full_html top_level: true related: { } diff --git a/core/modules/help/src/Controller/HelpController.php b/core/modules/help/src/Controller/HelpController.php index e7bd3d8..3f835dd 100644 --- a/core/modules/help/src/Controller/HelpController.php +++ b/core/modules/help/src/Controller/HelpController.php @@ -11,6 +11,7 @@ use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; +use Drupal\Core\Utility\Token; use Drupal\Component\Utility\String; use Drupal\help\Entity\HelpTopic; use Drupal\help\HelpInterface; @@ -37,6 +38,13 @@ class HelpController extends ControllerBase { protected $helpStorage; /** + * The token replacement service class. + * + * @var \Drupal\Core\UtilityToken + */ + protected $token; + + /** * Creates a new HelpController. * * @param \Drupal\Core\Routing\RouteMatchInterface $route_match @@ -44,9 +52,10 @@ class HelpController extends ControllerBase { * @param \Drupal\Core\Entity\EntityStorageInterface $help_storage * The entity storage for help topic entities. */ - public function __construct(RouteMatchInterface $route_match, EntityStorageInterface $help_storage) { + public function __construct(RouteMatchInterface $route_match, EntityStorageInterface $help_storage, Token $token) { $this->routeMatch = $route_match; $this->helpStorage = $help_storage; + $this->token = $token; } /** @@ -55,7 +64,8 @@ public function __construct(RouteMatchInterface $route_match, EntityStorageInter public static function create(ContainerInterface $container) { return new static( $container->get('current_route_match'), - $container->get('entity.manager')->getStorage('help_topic') + $container->get('entity.manager')->getStorage('help_topic'), + $container->get('token') ); } @@ -218,7 +228,7 @@ public function helpEntityView(HelpInterface $help_topic) { $body = $help_topic->get('body'); $build['body'] = array( '#type' => 'processed_text', - '#text' => $body['value'], + '#text' => $this->token->replace($body['value']), '#format' => $body['format'], );