Commit a5e7c596 authored by alexpott's avatar alexpott
Browse files

Issue #2162005 followup by Berdir: Clean up entity_reference default values...

Issue #2162005 followup by Berdir: Clean up entity_reference default values once users 0 and 1 provides UUID.
parent d7d58725
......@@ -72,11 +72,12 @@ public static function processDefaultValue($default_value, ContentEntityInterfac
->getStorage($target_type)
->loadMultiple($entity_ids);
$entity_uuids = array();
foreach ($entities as $id => $entity) {
$entity_uuids[$entity->uuid()] = $id;
}
foreach ($uuids as $delta => $uuid) {
if ($entity_uuids[$uuid]) {
if (isset($entity_uuids[$uuid])) {
$default_value[$delta]['target_id'] = $entity_uuids[$uuid];
unset($default_value[$delta]['target_uuid']);
}
......
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