Prevent errors trying to get values where are none
Notice: Trying to get property 'title' (and then 'value') of non-object Ref #108
This commit is contained in:
parent
81af737226
commit
1ab0ad4b3e
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ function geo_citation_pseudo_field($entity) {
|
|||
return $markup;
|
||||
}
|
||||
|
||||
$authors = $entity->field_authors->entity->title->value;
|
||||
$authors = isset($entity->field_authors->entity) ? $entity->field_authors->entity->title->value : '';
|
||||
$date = $entity->field_publication_date->value;
|
||||
$year = substr($date, 0, 4);
|
||||
$title = $entity->title->value;
|
||||
|
|
Loading…
Add table
Reference in a new issue