diff --git a/core/modules/views/src/Plugin/views/field/EntityField.php b/core/modules/views/src/Plugin/views/field/EntityField.php index e0b0f3841b212ac9d1dac711f29555a16a9088f9..2c6ae520e461631a2819606a7d933a7c8dee4d91 100644 --- a/core/modules/views/src/Plugin/views/field/EntityField.php +++ b/core/modules/views/src/Plugin/views/field/EntityField.php @@ -356,6 +356,9 @@ public function clickSort($order) { * * @return \Drupal\Core\Field\FieldStorageDefinitionInterface * The field storage definition used by this handler. + * + * @throws \Exception + * If no field storage definition was found for the given entity type and field name. */ protected function getFieldStorageDefinition() { $entity_type_id = $this->definition['entity_type']; @@ -391,7 +394,7 @@ protected function getFieldStorageDefinition() { } } - return NULL; + throw new \Exception("No field storage definition found for entity type {$this->definition['entity_type']} and field {$this->definition['field_name']} on view {$this->view->storage->id()}"); } /**