First of all - thank You for brilliant module! I think it is great job for D7 and I'm addicted!
Now my problem:
I have field collection 'field_participant' constructed with few simple text fields:
'field_participant_first_name'*
'field_participant_last_name'*
'field_participant_phone'.
Stars (*) means 'required'.
'field_participant' in my node type 'event' is multivalue. It is in 'group_participant'.
I have also some other groups, like 'invoice', which are before and after 'group_participant' and has require(*) fields.
To the point:
After hitting "Add more items" under multivalue collection 'field_participant' without fill-in previous required fields from other group error occurs:
An illegal choice has been detected. Please contact the site administrator.
I don't think that filling empty form fields is the job for administrator.
The /admin/reports/dblog says:
Illegal choice ... in ... element.
but element is not relevant to 'field_participant' so this is definitely confusing for acting person (and problem for administrator).
Proposal of solution:
1) Easy (lazy/ugly): change error message to be more specific (anonymous cant access dblog report) - catch what goes to dblog and show it in drupal_message_box for acting user after hitting Add more items
2) Harder: change ajax validation range only to current form item (or whatever devs calls it) not to all form
3) Disable validation for all form when adding field of multivalue collection field item. Validation can be done after hitting Submit button
As I said: I'm not dev, just Drupalist. I hope you find this case useful and worth to change.
Comments
Comment #1
thlor commentedI have the same issue, and #3 in #1263840: Adding multiple field collection field instances containing a node reference produces errors on node add form (required field) seems to have found the problem.
Since there are required items other than your field collection, the validation gives an error. It seems like a pretty important bug!
Comment #2
jmuzz commentedYou're right it shouldn't make an error for the administrator. I don't think it does this anymore. I just tried it by making a field collection with 2 fields (1 required) and I could add more of them in the embedded form if they were all blank, or I would get an appropriate error if only the non required field was filled in. Please reopen if it is still happening for you. If you have other problems with required fields try this issue. #1289062: Required fields in collection not validated when empty