- 🇧🇾Belarus drupalprojects
Guys, the fix doesn't work properly. I've installed latest 7.x-1.x-dev version and one of my users complained that he cannot save a form anymore. The form has a field_collection item (non-mandatory itself) with 2 mandatory fields inside the collection.
I assume that if a field collection is not marked as mandatory - I should be able to save the form without adding any values to it. So with this patch applied - it didn't work properly and it took me years to find a root cause for that.
Once I added the check forif (!empty($element['#field_collection_required_elements']) && !field_collection_item_is_empty($field_collection_item))
on line 1788 of field_collection.module - it is working properly now.By the way, I have another field_collection item on the same node which is mandatory and with my fix it is still validating that other mandatory field properly.
- Status changed to Needs review
almost 2 years ago 9:59am 30 January 2023 - 🇪🇸Spain trebormc Barcelona
#9 works well for me.
My client had the same problem as mentioned in #8.