If you enable one of the blocks provided by the forum module but don't have any forum topics on your site yet, the block displays on your site with its title only (and no content whatsoever).

That is a bug. There are two patterns in Drupal that are used for the "empty block" situation: (1) don't display the block at all, or (2) display with some appropriate empty text such as "No content available".

Since the forum module blocks do some crazy pre-rendering stuff, I'm not sure how we would accomplish (1), and anyway, (2) seems to be the better pattern that we are moving to for content-related blocks in Drupal core. So, this patch does that.

It might be better to say something like "No topics available" instead, but that would be adding a string. This patch doesn't add any new translatable strings.

CommentFileSizeAuthor
forum-empty-block.patch721 bytesDavid_Rothstein
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, forum-empty-block.patch, failed testing.

David_Rothstein’s picture

Status: Needs work » Needs review

forum-empty-block.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, forum-empty-block.patch, failed testing.

Jody Lynn’s picture

Status: Needs work » Needs review

forum-empty-block.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, forum-empty-block.patch, failed testing.

David_Rothstein’s picture

Status: Needs work » Needs review

Broken testbot, I assume.

mohit1604’s picture

Issue summary: View changes

@David_Rothstein , what do you mean by 'block' provided by forum module ? Does it mean 'General Discussion' option that is available in forum type ?

David_Rothstein’s picture

This refers to the "Active forum topics" and "New forum topics" blocks that the Forum module exposes for placement on the Blocks administration page (at admin/structure/block).

Looks like Drupal 8 has those blocks also, but doesn't have this bug - the blocks don't display at all if they are empty. So this issue can remain on Drupal 7 and would still be useful to fix there.

bakerlee’s picture

Hi,
Can you please clarify for me what the fix is for the Active Forum Topics header displaying when there are no topics? I have this issue on my site and am using 7.6.1.
Thanks!