There's an issue (with a patch) for Field Collection to completely hide empty collections. Since this module replaces the field collection widget, it needs its own patch to achieve this too.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BWPanda’s picture

Status: Active » Needs review
FileSize
1.45 KB

Here's the same code from the latest patch at the above issue applied to this module. Works for me (i.e. hides the collection label completely when the collection is empty).

glynster’s picture

BWPanda I was wondering if you might be able to help me in my situation. I created a new case but have not had any feedback. Here it is for your reference: http://drupal.org/node/1708258

When I choose the "Table of field collection items" for the field I have the issue above in that the thead with labels is suddenly printed inside the tbody thus printing the labels when the table should actually not print. I applied your patch in the hope that this may have fixed the issue - but no luck.

Any ideas or solutions would be very helpful.

MichaelP’s picture

There was a typo in the patch ([elements] -> [element])

Rerolled.

Works ok for me, thanks @BWPanda

glynster’s picture

OK makes all the difference.
I now see the option inside views and once applied it works like a charm.
Thanks for the re-roll.

BWPanda’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for spotting that MichaelP!

rjdjohnston’s picture

Works beautifully! +1 for adding to core module.

NancyDru’s picture

Status: Reviewed & tested by the community » Needs work

Patch failed and called out trailing whitespace.

Altcom_Alan’s picture

Status: Needs work » Needs review
FileSize
1.7 KB

Patch in #3 worked for me on 7.x-1.0-beta1.

I've added the hide collection setting to the summary info.

robinmarshall’s picture

Thanks, that works perfectly for me, look forward to seeing this in the release.

OFF’s picture

Issue summary: View changes

Patches dont work for me.. I see empty collections titles.

Trying apply to stable release..

caw67’s picture

patch works
please commit!

BWPanda’s picture

Here's an updated patch for the latest dev version.

glynster’s picture

Thanks @BWPanda any chance we can get this committed?

BWPanda’s picture

A good first step would be testing and marking this issue as RTBC :)

glynster’s picture

I committed this patch and works again just like before! RTBC

BWPanda’s picture

Status: Needs review » Reviewed & tested by the community
gambry’s picture

Just to re-confirm: patch works perfectly and it would be good to have this pushed on next version, as having the label on the page when there are no items is quite annoying :( .

Thanks!

gambry’s picture

Actually to be correct a hook_field_formatter_view should always return the $element array(), in this case as empty.

The patch just swaps:

return;

with

return $elements;
nevergone’s picture

Patch re-rolled and tested: works well!

  • websystem committed 1b54c7a on 7.x-1.x authored by nevergone
    Issue #1653626 by BWPanda, gambry, MichaelP, aBrookland, nevergone: Hide...
kevineinarsson’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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