First, thanks for the module and taking the time to maintain :-)

If a field collection contains no data it still returns wrapper data, in my case to CCK blocks. This is problematic for themers, styling, etc..

I have fixed this by changing line 1258 to: -

return empty($element[0]) ? NULL : $element;

I'm not sure if this is the best way but it works for me.

Can this please be changed on the module. Apologies for not submitting a proper patch - I can't easily do this from here.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jmuzz’s picture

Status: Active » Needs review
elpino’s picture

Works for me too.

Allthough, probably because of the module version (in my case 7.x-1.0-beta7), I actually had to edit line 1275.

sherakama’s picture

Seems to work well enough for me. Patched attached based on initial report.

Status: Needs review » Needs work

The last submitted patch, 3: field_collection-empty-value-markup-2225697-3.patch, failed testing.

sherakama’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: field_collection-empty-value-markup-2225697-3.patch, failed testing.