diff --git a/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php index 6b760a95489cabcec209b48ca60c3b6ff7e01b7d..d7dfc31ee954fb5ff86975deee7bb0ccf20f038d 100644 --- a/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php +++ b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php @@ -21,6 +21,7 @@ abstract class ForumBlockBase extends BlockBase { */ public function build() { $result = $this->buildForumQuery()->execute(); + $elements = array(); if ($node_title_list = node_title_list($result)) { $elements['forum_list'] = $node_title_list; $elements['forum_more'] = array( diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php index 3799288956de19f1d992b41b409a5f07d9903435..1295c822aaf63eed6606cd77a7c77d5da667263c 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php @@ -55,13 +55,14 @@ function setUp() { public function testNewForumTopicsBlock() { $this->drupalLogin($this->adminUser); - // Create 5 forum topics. - $topics = $this->createForumTopics(); - // Enable the new forum topics block. $block = $this->drupalPlaceBlock('forum_new_block'); $this->drupalGet(''); + // Create 5 forum topics. + $topics = $this->createForumTopics(); + + $this->assertLink(t('More'), 0, 'New forum topics block has a "more"-link.'); $this->assertLinkByHref('forum', 0, 'New forum topics block has a "more"-link.');