-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_module_add_check_for_null_values.patch
20 lines (19 loc) · 1.49 KB
/
view_module_add_check_for_null_values.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php
index 8e51d69..fa7df4b 100644
--- a/core/modules/views/src/EntityViewsData.php
+++ b/core/modules/views/src/EntityViewsData.php
@@ -384,12 +384,12 @@ class EntityViewsData implements EntityHandlerInterface, EntityViewsDataInterfac
* A reference to a specific entity table (for example data_table) inside
* the views data.
*/
- protected function mapFieldDefinition($table, $field_name, FieldDefinitionInterface $field_definition, TableMappingInterface $table_mapping, &$table_data) {
+ protected function mapFieldDefinition($table, $field_name, FieldDefinitionInterface $field_definition = null, TableMappingInterface $table_mapping, &$table_data) {
// Create a dummy instance to retrieve property definitions.
$field_column_mapping = $table_mapping->getColumnNames($field_name);
- $field_schema = $this->getFieldStorageDefinitions()[$field_name]->getSchema();
+ $field_schema = !empty($this->getFieldStorageDefinitions()[$field_name]) ? $this->getFieldStorageDefinitions()[$field_name]->getSchema() : null;
- $field_definition_type = $field_definition->getType();
+ $field_definition_type = !empty($field_definition) ? $field_definition->getType() : null;
// Add all properties to views table data. We need an entry for each
// column of each field, with the first one given special treatment.
// @todo Introduce concept of the "main" column for a field, rather than