- Issue created by @Tim Lammar
- 🇧🇪Belgium Tim Lammar
Update: entity reference with checkboxes is an empty array in opposite of radio buttons.
I see it sort of appearing on several tickets but always more specific, or other context, so submitting new ticket.
Sorry in advance if I missed a relevant ticket.
For now a simple patch, because I feel this needs to worked out more for other cases.
What I saw is that when working with entity reference, the server side validation doesn't work.
My specific case: an entity reference field with radios as widget not getting errors on form submit.
What I noticed in code is that the key to determine that a required field is not filled in is to check if the value is empty.
For entity reference however, that value is a array with null for target_id. That doesn't however count as empty.
As said before, other cases might be there as well, so I'm using switch, even though I only tackle my case and default for now.
Active
4.0
Code
Update: entity reference with checkboxes is an empty array in opposite of radio buttons.