I have a content type “A” (Node entity type). In it’s node form (new/edit) I need to check if some fields are empty or not (which are not required in general). My first intention was to use FormState “getValue”, “isValueEmpty”, “hasValue” functions, but I can’t figure out how to easily solve this problem:
- Text fields has value:
array("value"=> "")
if they are empty, and it’s not considered empty by the functions above (so I can’t use them) - I could check by myself for
isset($field['value'])
, but there are also file fields and entity reference fields which has a whole different “value” structure.
So what would be a clean way to achieve this?