Skip to content
Snippets Groups Projects
Commit 7abdb654 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2350309 by droplet, larowlan: Forum index links head to...

Issue #2350309 by droplet, larowlan: Forum index links head to taxonomy/term/{term} instead of forum/{term}
parent 12bdc6cd
No related branches found
No related tags found
No related merge requests found
......@@ -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';
......
......@@ -10,6 +10,7 @@
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 @@ protected function setUp() {
*/
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment