- 🇧🇪Belgium rodrigo panchiniak fernandes
Following discussion thread in #52, and being broadly in the same scenario (custom entity reference field type and a widget that extends
EntityReferenceAutocompleteWidget
), for me the validation error could be avoided by making$form_state->setValueForElement($element, ['target_id' => null])
when the field is submitted empty, in thevalidate
method.