If I set the field collection "number of values" to 5, then only 4 field collections will show on the entity edit form. In order to get 5 entries I have to set it to 6. This seems to been a new bug introduced recently.

I haven't tried the dev version since it's date is the same at the beta5.

CommentFileSizeAuthor
#9 1890646-9.patch998 bytesmike.davis
#6 field_collection_trim.zip2.35 KBsydneyshan

Comments

artis’s picture

Title: When the number of values is set to a fixed number there is one fewer field collectin in the entity edit form. » When the number of values is set to a fixed number there is one fewer field collection in the entity edit form.

Fixed spelling error in title.

ludo.r’s picture

I confirm this bug.

I've set my field collection to 7 values, and the form only shows 6 field collections. I've noticed this bug since upgrade from beta4 to beta5.

There is another related issue : #1888988: Alter Field with hook_form_alter

ludo.r’s picture

There is a new option on the field widget settings form, right under the number of values.

Unchecking "Hide blank items" solves the problem.
But I guess this is just a workaround, as this is still a bug.

ericclaeren’s picture

Hi, I also can confirm this bug, seems quite an error. Has anybody already found an solution for this problem?

TeeganB’s picture

I have also noticed this bug. I had to untick hide blank items to get the correct value to display.

sydneyshan’s picture

StatusFileSize
new2.35 KB

I wrote this little module to overcome these issues before the 'hide blank items' option was added. I still think it does a far better job than the recent addition.

7.x-1.0-beta5 does not allow you to remove the last field collection item even if you have set the field to 'not required' and 'unlimited'. By using the attached module you can have field collections with zero entries if required, and the bug above shouldn't occur either.

adamb’s picture

I have experienced noticed this bug. Unticking 'hide blank items' gets the correct value to display.

timodwhit’s picture

I am currently experiencing this issue as well.

mike.davis’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new998 bytes

Looking at the functionality of the 'Hide blank items', it only seems to be relevant for the 'unlimited' option.

Here is a patch that hides the 'Hide blank items' checkbox and sets its value to be 'checked' as there is no reason for it to not be really.

jmuzz’s picture

Status: Needs review » Closed (duplicate)

I am not sure I agree with that explanation for the option, and I've explained why in #2177963: 'Hide blank items' setting doesn't work correctly.. If you can shed some more light on this please post some more details there.