diff --git a/core/modules/help/src/Controller/HelpController.php b/core/modules/help/src/Controller/HelpController.php index ec4bd47..4785af7 100644 --- a/core/modules/help/src/Controller/HelpController.php +++ b/core/modules/help/src/Controller/HelpController.php @@ -143,7 +143,7 @@ protected function helpTopicsList() { if ($entity->get('top_level')) { $topics[] = array( 'title' => $entity->label(), - 'url' => new Url('help.topic_view', array('id' => $entity->id())), + 'url' => $entity->urlInfo('canonical'), ); } } @@ -239,7 +239,8 @@ public function helpEntityView(HelpInterface $help) { if ($title = $topic->get('label')) { $links[] = array( 'title' => $title, - ) + Url::fromRoute('help.topic_view', array('id' => $other_id))->toArray(); + 'url' => $topic->urlInfo('canonical'), + ); } } } diff --git a/core/modules/help/src/Entity/Help.php b/core/modules/help/src/Entity/Help.php index f8924ea..faef0ec 100644 --- a/core/modules/help/src/Entity/Help.php +++ b/core/modules/help/src/Entity/Help.php @@ -49,6 +49,7 @@ * }, * admin_permission = "administer help topics", * links = { + * "canonical" = "entity.help.canonical", * "add-form" = "entity.help.add_form", * "edit-form" = "entity.help.edit_form", * "delete-form" = "entity.help.delete_form" diff --git a/core/modules/help/src/HelpBreadcrumbBuilder.php b/core/modules/help/src/HelpBreadcrumbBuilder.php index f1a7903..3ad56eb 100644 --- a/core/modules/help/src/HelpBreadcrumbBuilder.php +++ b/core/modules/help/src/HelpBreadcrumbBuilder.php @@ -33,7 +33,7 @@ public function __construct(TranslationInterface $string_translation) { * {@inheritdoc} */ public function applies(RouteMatchInterface $route_match) { - return $route_match->getRouteName() == 'help.topic_view'; + return $route_match->getRouteName() == 'entity.help.canonical'; } /** diff --git a/core/modules/help/src/HelpListBuilder.php b/core/modules/help/src/HelpListBuilder.php index b2df57a..2dcd169 100644 --- a/core/modules/help/src/HelpListBuilder.php +++ b/core/modules/help/src/HelpListBuilder.php @@ -9,7 +9,6 @@ use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Url; /** * Provides an entity list builder class for Help topic entities. @@ -34,7 +33,7 @@ public function buildHeader() { public function buildRow(EntityInterface $entity) { $row = array(); - $row['label'] = $entity->label(); + $row['label'] = $this->getLabel($entity); $row['id'] = $entity->id(); return $row + parent::buildRow($entity); @@ -46,12 +45,12 @@ public function buildRow(EntityInterface $entity) { public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); - $url = Url::fromRoute('help.topic_view', array('id' => $entity->id())); if ($entity->access('view')) { $operations['view'] = array( 'title' => $this->t('View'), 'weight' => 0, - ) + $url->toArray(); + 'url' => $entity->urlInfo('canonical'), + ); } return $operations;