How do I check if a field is empty? On my views-view-field template, I would like to print out 'field_images' if 'field_cover_image' is empty.
I tried this solution here but it throws me this error message.

Notice: Undefined variable: node in include() (line 45 of /sites/all/themes/mytheme/templates/views-view-fields--incubator.tpl.php).
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7539 of /includes/common.inc).

Is there any other ways to check if a field is empty or not?
Thanks!
You get that error because $node is not one of the variables passed to views-view-fields.tpl.php, which receives:


$view: The view in use.
$fields: an array of $field objects.
$row: The raw result object from the query, with all data it fetched.


Basing on the description, $row could be used to retried the node object. I cannot tell you the content of that variable, but using print_r() from your template file can help to understand its content.