Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / views / src / Plugin / views / field / EntityField.php
index ee2882c3b5b0b93095f9fdfedcd08414bca64b0a..f26c188d3ba69abeb9c57dcf5bb28e922de6baad 100644 (file)
@@ -408,10 +408,10 @@ class EntityField extends FieldPluginBase implements CacheableDependencyInterfac
     ];
 
     $options['multi_type'] = [
-      'default' => 'separator'
+      'default' => 'separator',
     ];
     $options['separator'] = [
-      'default' => ', '
+      'default' => ', ',
     ];
 
     $options['field_api_classes'] = [
@@ -1052,6 +1052,12 @@ class EntityField extends FieldPluginBase implements CacheableDependencyInterfac
    */
   public function getValue(ResultRow $values, $field = NULL) {
     $entity = $this->getEntity($values);
+
+    // Ensure the object is not NULL before attempting to translate it.
+    if ($entity === NULL) {
+      return NULL;
+    }
+
     // Retrieve the translated object.
     $translated_entity = $this->getEntityFieldRenderer()->getEntityTranslation($entity, $values);