diff --git a/core/modules/help_topics/help_topics.module b/core/modules/help_topics/help_topics.module index 76e89425b7..7b860b5ea8 100644 --- a/core/modules/help_topics/help_topics.module +++ b/core/modules/help_topics/help_topics.module @@ -7,7 +7,6 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; -use Drupal\help_topics\Plugin\HelpTopic\HelpTopicTwig; /** * Implements hook_help(). diff --git a/core/modules/help_topics/src/Controller/HelpTopicPluginController.php b/core/modules/help_topics/src/Controller/HelpTopicPluginController.php index 5cdd79473c..37eb58a919 100644 --- a/core/modules/help_topics/src/Controller/HelpTopicPluginController.php +++ b/core/modules/help_topics/src/Controller/HelpTopicPluginController.php @@ -7,7 +7,7 @@ use Drupal\help_topics\Plugin\HelpTopic\HelpTopicPluginManagerInterface; use Drupal\Core\Render\RendererInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * Controller for help topic plugins. @@ -65,7 +65,7 @@ public function viewHelpTopic($id) { $build = []; if (!$this->helpTopicPluginManager->hasDefinition($id)) { - throw new AccessDeniedHttpException(); + throw new NotFoundHttpException(); } /* @var \Drupal\help_topics\Plugin\HelpTopic\HelpTopicPluginInterface $help_topic */ $help_topic = $this->helpTopicPluginManager->createInstance($id); diff --git a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php index e7b06b0b0f..fa2ed0d642 100644 --- a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php +++ b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicPluginManager.php @@ -8,7 +8,6 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Plugin\Factory\ContainerFactory; -use Drupal\Component\Utility\Html; /** * Provides the default help_topic manager. @@ -235,7 +234,7 @@ public function getThemeImplementations() { $return[$hook] = [ 'variables' => [], 'path' => drupal_get_path('module', $definition['provider']) . '/help_topics/templates', - 'template' => Html::cleanCssIdentifier($hook), + 'template' => $hook, ]; } return $return; diff --git a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php index 49efd558b7..84a217076e 100644 --- a/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php +++ b/core/modules/help_topics/src/Plugin/HelpTopic/HelpTopicTwig.php @@ -5,6 +5,7 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; +use Drupal\Component\Utility\Html; /** * Represents a help topic plugin whose definition comes from a YAML file. @@ -80,7 +81,7 @@ public function getBody() { * Theme hook. */ public static function getThemeHook($plugin_id) { - return 'help_topic_' . $plugin_id; + return Html::cleanCssIdentifier('help_topic_' . $plugin_id); } }