Issue as outlined in https://www.drupal.org/node/2443457 is in regression.
As requested by @dawehner I'm opening a new issue instead of re-opening the old one.
There on the old issue there are 2 people posts outlining they're having the same problem, and with myself that makes 3.
Here is @didaka 's steps to reproduce.
I have just faced this issue again in Drupal 8.0.2.
Steps to replicate on a boilerplate Drupal 8.0.2. with Bartik on simplytest.me:
Create a view with a block that accepts nid as default argument from url.
Add argument validation that hides the view. Basic validation will be enough.
Set "Hide block if the view output is empty: Yes"
Display the block in the empty sidebar_second (Left sidebar) on Bartik.
Create an article node. The secondary sidebar should show the node title.
Go to frontpage. The secondary sidebar is rendered, but empty. Body classes are also added.
I can confirm this happens in Drupal 8.0.5
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | empty_region_rendered-2685157-2-TEST_ONLY.patch | 1.5 KB | lendude |
Comments
Comment #2
lendudeHmm I'm not sure if this is a Views issue or a page layout issue. The block isn't rendered at all, so the 'block_hide_empty' works as advertised. But the page thinks something will be rendered, so the region is rendered (and then turns out to be empty).
Adding a test to illustrate the problem, but again, not sure if Views is the right place to test or fix this.
Comment #3
lendudeOh and any empty Views block will make this happen.
So making a block showing content filtered on a content type that has no nodes works just as well as the steps outlined in the issue summary.
Comment #5
lendudeHmm looking at it more this just seems like a duplicate/symptom of #953034: [meta] Themes improperly check renderable arrays when determining visibility.
Comment #6
3eidoz commentedI'm having the same issue in D8.0.5
Comment #8
wim leers#5: indeed.
Comment #9
m.zerres commentedI have the same issue with a menu block i.e. in the first sidebar. Even it is empty the following code is rendered:
This happens in Bartik
Comment #10
m.zerres commentedComment #11
3eidoz commentedstill in D8.1.3
Comment #12
lendudeClosing this as a duplicate of #953034: [meta] Themes improperly check renderable arrays when determining visibility, this has nothing to do with Views or Menu, but only with placeholders for dynamic blocks (which Views and Menus tend to be).
Comment #13
jwilson3Cross-post from #2443457. Just following up here that the current workaround until a solution to #953034: [meta] Themes improperly check renderable arrays when determining visibility lands is to render the output of the region the block is placed in to determine whether to render the region.
Eg. in page.html.twig in your theme: