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

Issue #2228941 by larowlan, andrei.dincu | Cottser: PHP notice displayed for...

Issue #2228941 by larowlan, andrei.dincu | Cottser: PHP notice displayed for forum blocks when there are no forum topics.
parent 27a651a6
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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(
......
......@@ -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.');
......
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