In this module's hook_field_attach_submit implementation, a fields value will get set to an empty array if $entity_ids is empty (example value: $entity->field['und'] = array()). This causes problems when other modules check the field value using empty(). We should do an empty check on the $entity_ids array before setting the field value via the wrapper.
I came across this issue when building a commerce license project. During commerce_cart_add_to_cart_form_submit(), field_attach_submit() is called which set the commerce_license field on my line item to an empty value. Then when commerce_license_commerce_line_item_presave() hook was triggered, the empty($line_item->commerce_license) was providing a false result and the license wouldn't be created. The attached patch fixes this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| inline_entity_form-dont_set_empty_field_values.patch | 720 bytes | andyg5000 |
Comments
Comment #1
andyg5000Comment #2
bojanz commentedGood catch.
Committed, thanks!