diff --git a/views/src/Plugin/views/field/Field.php b/views/src/Plugin/views/field/Field.php index 6d318c4..1d605b7 100644 --- a/views/src/Plugin/views/field/Field.php +++ b/views/src/Plugin/views/field/Field.php @@ -850,8 +850,10 @@ public function getItems(ResultRow $values) { */ protected function createEntityForGroupBy(EntityInterface $entity, ResultRow $row) { // Retrieve the correct translation object. - $processed_entity = clone $this->getEntityFieldRenderer()->getEntityTranslation($entity, $row); - + $processed_entity = FALSE; + if (is_object($entity)) { + $processed_entity = clone $this->getEntityFieldRenderer()->getEntityTranslation($entity, $row); + } // Copy our group fields into the cloned entity. It is possible this will // cause some weirdness, but there is only so much we can hope to do. if (!empty($this->group_fields) && isset($entity->{$this->definition['field_name']})) {