diff options
-rw-r--r-- | core/modules/forum/forum.module | 2 | ||||
-rw-r--r-- | core/modules/forum/src/Tests/ForumTest.php | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index d4be4f5547a..c5e6d41b1a9 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -568,7 +568,7 @@ function template_preprocess_forum_list(&$variables) { // Sanitize each forum so that the template can safely print the data. foreach ($variables['forums'] as $id => $forum) { $variables['forums'][$id]->description = Xss::filterAdmin($forum->description->value); - $variables['forums'][$id]->link = $forum->url(); + $variables['forums'][$id]->link = forum_uri($forum); $variables['forums'][$id]->name = String::checkPlain($forum->label()); $variables['forums'][$id]->is_container = !empty($forum->forum_container->value); $variables['forums'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even'; diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php index 57239a46211..c716f5ad6c7 100644 --- a/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -10,6 +10,7 @@ namespace Drupal\forum\Tests; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Link; use Drupal\simpletest\WebTestBase; +use Drupal\Core\Url; /** * Create, view, edit, delete, and change forum entries and verify its @@ -107,9 +108,9 @@ class ForumTest extends WebTestBase { */ function testForum() { //Check that the basic forum install creates a default forum topic - $this->drupalGet("/forum"); + $this->drupalGet('/forum'); // Look for the "General discussion" default forum - $this->assertText(t("General discussion"), "Found the default forum at the /forum listing"); + $this->assertRaw(t('<a href="'. Url::fromRoute('forum.page', ['taxonomy_term' => 1]) .'">General discussion</a>'), "Found the default forum at the /forum listing"); // Do the admin tests. $this->doAdminTests($this->admin_user); |