How to read a Entity reference node's fields?
&lt;?php

/**
 * We define a new function in our MODULE and will simply use it where needed.
 *
 */

/**
 * @param (object) $node
 * @param (string) $field_name
 * @return false|null|integer
 *    The target id. FALSE on error. NULL when no reference found.
 */
function _MODULE_get_node_reference($node, $field_name) {
    $target_id = null;
    if (!isset($node-&gt;type)) {
        return false;
    }
    // In case of any exception we simply return false.
    try {
        $entity_wrapper = entity_metadata_wrapper('node', $node);
        if (isset($entity_wrapper-&gt;{$field_name})) {
            $target_id = $entity_wrapper-&gt;{$field_name}-&gt;value();
        }
        // maybe we are in the middle of a DB transaction. In that case entity_metadata_wrapper() would not work
        if (empty($target_id)) {
            // So, we try using Fields API. This always works.
            $items = field_get_items('node', $node, $field_name);
            if (isset($items[0])) {
                $target_id = $items[0]['target_id'];
            }
        }
    } catch (Exception $e) {
        return false;
    }
    return $target_id;
}

?&gt;