🇧🇾Belarus @drupalprojects

Account created on 9 March 2007, about 18 years ago
#

Recent comments

🇧🇾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 for if (!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.

Production build 0.71.5 2024