Last active
February 29, 2016 15:01
-
-
Save alex-kirienko/8377a3c7594e9913f736 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function build_some_render_array($field) { | |
$build = array(); // Drupal render array | |
// more stuff happens here | |
$entity = $field['entity']; | |
$entity_wrapper = entity_metadata_wrapper('node', $entity); | |
try { | |
$value = $entity_wrapper->field_some_name->value(); | |
// more code | |
return $result; | |
} | |
catch (Exception $e) { | |
// do nothing | |
} | |
return drupal_render($build); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment