Commit 54152707 authored by catch's avatar catch

Issue #2189007 by amateescu: Update...

Issue #2189007 by amateescu: Update FieldableDatabaseStorageController::mapToStorageRecord() now that all field types have a schema.
parent 728c4ddd
...@@ -687,11 +687,9 @@ protected function mapToStorageRecord(EntityInterface $entity, $table_key = 'bas ...@@ -687,11 +687,9 @@ protected function mapToStorageRecord(EntityInterface $entity, $table_key = 'bas
foreach (array_keys($multi_column_fields) as $field_name) { foreach (array_keys($multi_column_fields) as $field_name) {
$field_items = $entity->get($field_name); $field_items = $entity->get($field_name);
$field_value = $field_items->getValue(); $field_value = $field_items->getValue();
// @todo Reconsider the usage of getPropertyDefinitions() after foreach (array_keys($field_items->getFieldDefinition()->getColumns()) as $field_schema_column) {
// https://drupal.org/node/2144327. if (isset($schema['fields'][$field_name . '__' . $field_schema_column])) {
foreach (array_keys($field_items[0]->getPropertyDefinitions()) as $property_name) { $values[$field_name . '__' . $field_schema_column] = isset($field_value[0][$field_schema_column]) ? $field_value[0][$field_schema_column] : NULL;
if (isset($schema['fields'][$field_name . '__' . $property_name])) {
$values[$field_name . '__' . $property_name] = isset($field_value[0][$property_name]) ? $field_value[0][$property_name] : NULL;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment