To reproduce the bug:

  1. You must have a field collection field (set as not required and of unlimited cardinality) holding at least two required fields
  2. On node edit form enter a value to one of the field-collection field leaving the other empty
  3. Click the "Add another item"

This will trigger the validation saying that the empty field is required.

CommentFileSizeAuthor
#1 1426078.patch1.16 KBdrikc

Comments

drikc’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB

The attached patch skip the validation process for embedded fields when the button "Add another item" is used.

tim.plunkett’s picture

What's wrong with validating there? Not sure that this is a true "bug".

drikc’s picture

Me neither, but I had a user reporting it as bug; he wanted to add a field-collection item without having to complete the requirement of existing items. Perhaps having the validation at submit is sufficient and having it on "Add another item" isn't necessary.

iLLin’s picture

You shouldn't be able to add another collection if the previous one isn't filled out correctly. I think this works as designed. The only slight issue I have found that provides a weird user experience around this is if I click submit and there is an error in the form, errors are displayed at the top. If immediately hit "add another item", then there is another set of errors around the field collection within the form. So essentially it is displaying two error message sets on the form. Bug? No... Weird UX? Yes. I am going to solve that issue with JS as I am using AJAX forms anyway.

As far as this issue being a "bug", I don't agree.

iLLin’s picture

Issue summary: View changes

Removed a dot

jmuzz’s picture

Category: Bug report » Feature request
Issue summary: View changes
Status: Needs review » Needs work

Both behaviors have merit. I see no reason to change the default, but validating the form at submission time would be a nice option to have if somebody wants to add an option for it.