Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The 'empty' state of (core) blocks is ehm, quite empty, showing only a "(empty)" piece of text.
I found this in dashboard.module:
$block->content = array('#markup' => '<div class="dashboard-block-empty">(empty)</div>');
Can we add some per-block specificity here, like "No comments/forum topics/blog posts available"?
Comment | File | Size | Author |
---|---|---|---|
#7 | dashboard-empty-787924-7.patch | 976 bytes | David_Rothstein |
#5 | Screen shot 2011-01-08 at 11.25.32 PM.png | 49.22 KB | Jody Lynn |
Comments
Comment #1
yoroy CreditAttribution: yoroy commentedThe totally empty one for 'Active forum topics' is probably a bug worthy of its own issue?
As you can see, the 'recent content' block does have its own specific 'empty' message.
Comment #2
yoroy CreditAttribution: yoroy commentedtag
Comment #3
dmitrig01 CreditAttribution: dmitrig01 commentedWow this is bad. no translation either
Comment #4
yoroy CreditAttribution: yoroy commented#504428: Roll-out 'Empty text' pattern to other admin pages. for reference
Comment #5
Jody LynnRecent comments now shows an empty message.
The ones that show (empty) are blocks that outside of the dashboard would not appear at all (nothing is returned by hook_block_view when they are empty), whereas others return empty $block['contents'] and end up with blank content here.
I think nothing at all is better than (empty).
Comment #6
dmitrig01 CreditAttribution: dmitrig01 commentedComment #7
David_Rothstein CreditAttribution: David_Rothstein commentedI'm not sure there is much we can do about this issue in the dashboard module itself. The dashboard does need to have some handling for blocks that are truly empty (i.e., would not otherwise display at all). To make individual blocks display but with "No X available" there needs to be issues filed against the modules that provide those blocks, I think.
The forum module block is a weird special case and does seem like its own bug. I filed an issue with a patch to fix that here: #1045390: Forum module blocks display with no content when they are empty
Attached is a patch that fixes the fact that "(empty)" wasn't translated, though. It actually was translated in one place in the code, but not in this one for some reason.... so this doesn't add any new strings. We can at least get that out of the way quickly.
Comment #9
Jody LynnRetest.
Comment #10
yoroy CreditAttribution: yoroy commented#715790: Apply 'empty state' pattern to dashboard's recent content block marked as duplicate of this
Comment #11
thedavidmeister CreditAttribution: thedavidmeister commented#7: dashboard-empty-787924-7.patch queued for re-testing.
Comment #13
star-szrDashboard module is no longer in core, see #950956: Remove Dashboard from core . Moving to 7.x for consideration.