On a site I am going to have lots of groups not using this feature and it annoyed me that the block was always visible. With this patch the function will return empty strings and the block will be hidden if there are no items to show - the test runs for empty($items) after the code has went through its loop. I added a comment also (assuming commenting is generally good).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | og_aggregator-fixed-block-hiding-patch.patch | 1.48 KB | Tim_O |
| #1 | og_aggregator.patch | 1.34 KB | Taz |
| og_aggregator.module-hide-empty-block.patch | 766 bytes | Tim_O |
Comments
Comment #1
Taz commentedThanks for bringing this to attention.
As always, there's more than one way to skin a cat. I've made a new patch with checks at different stages.
The problem mas more or less with the 'more link' always displaying, despite no returned results.
See patch. Test it on 1.4 and let me know how you go :)
Comment #2
Tim_O commentedThank you, for looking into the issue. I tried to apply your patch against 6.x-1.4:
with the .rej being:
I applied you patch manually (by finding the position and doing those changes) and then made a patchfile myself (enclosed). Those files differ in the definition of line to be removed or so. I haven't really understand what my problem is here, any hints?
But I then was able to verify you changes once applied do the same, i.e. the block is hidden if empty - so cool with me otherwise :)
Comment #3
j0nathan commentedHi,
Would it be possible to do the same to hide the tab if there is no feed in an OG?
Comment #4
rootworkI'd love to see a patch that would hide the block or tab if it's empty. I have a site with lots and lots of groups, and only a few of them have feeds. The block is easier for me to control, because I'm overriding the display of the group pages through panels anyway. But the tab is hard to get rid of, and seems unnecessary when there's no content.
So: Would be great to see the hide-block patch included in a new dev, but I concur with #3 for a new feature request to hide the tab when empty.