As seen on Firefox 7:

Empty box with borders shown on home page due to empty div

Not sure when that started happening. Doesn't happen in 7.x.

Comments

webchick’s picture

Thanks to the magic of git bisect, I discovered that this bug is caused by #918808: Standardize block cache as a drupal_render() #cache. Cross-linking both issues.

reglogge’s picture

sub

moshe weitzman’s picture

Assigned: Unassigned » moshe weitzman

I'll take this ... IMO this is about as mild a UI bug as one could imagine, and it occurs when we are about 2 years from release.

moshe weitzman’s picture

StatusFileSize
new1.16 KB

Posted in the wrong issue, copied by chx.

chx’s picture

Status: Active » Needs review
webchick’s picture

Status: Needs review » Reviewed & tested by the community

w00t! That takes care of it. Thanks!

Not sure if we need tests for this or not. I spent about an hour trying to write a holistic test that spun through all of the enabled blocks, checked if they had visible content when rendered, and if not, asserting that they didn't show up on the page. After 3 attempts I gave up; our block API sucks. :\

So tentatively moving to RTBC here, but we'll see what catch says.

chx’s picture

Status: Reviewed & tested by the community » Needs work

$this->assertNoRaw('block-system-help')

Edit: yes, that's the whole test. wrap it in a class with getinfo and a test function but that's all you need to do, check the lack of that string just after install. Alternatively you can sneak it into another test to avoid a whole Drupal install for a single assert.

webchick’s picture

Status: Needs work » Reviewed & tested by the community

Yeah, that was my first attempt, but that's not really a test. It would prevent this particular problem from happening again, but the real bug is that the logic to prevent empty blocks from showing was broken.

moshe weitzman’s picture

I think the proposal is a reasonable test for 'prevent empty blocks from showing'.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Sorry, accidental cross-post there. Tagging.

webchick’s picture

Status: Needs work » Needs review
StatusFileSize
new1.63 KB

Oh, really? OK then...

webchick’s picture

StatusFileSize
new1.66 KB
new513 bytes

How about one where I don't take you quite so literally, and include an assertion message? :P

Two patches. One with just the test so you can see it failing, the other one with the test + patch.

Note that the patch resides in an overall test function called testBlockVisibility(), so it seems to be in an appropriate place.

jthorson’s picture

StatusFileSize
new1.66 KB
new513 bytes

Re-testing.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Well this means this needs a change node then because of what happened to book.

bfroehle’s picture

catch’s picture

Status: Reviewed & tested by the community » Fixed

This looks fine. I'm a bit concerned about adding a test that will continue to pass even if we don't have a help block in core any more, but can't think of a nice generic way to test this either that wouldn't be a pain. Committed and pushed.

The API change should be documented as part of #918808: Standardize block cache as a drupal_render() #cache, so putting straight to fixed.

Automatically closed -- issue fixed for 2 weeks with no activity.