From 82d44b7834e4e101c24ef6a96239a69d0e842b0e Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Sat, 15 Jun 2013 01:02:26 +0200 Subject: [PATCH] Issue #2016177 followup by yched: Refactor 'autocreate entity' handling from entity_reference(). --- core/modules/entity_reference/entity_reference.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 484ca310f740..5608b6bdfbe1 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -107,7 +107,7 @@ function entity_reference_field_is_empty($item, $field) { */ function entity_reference_field_presave(EntityInterface $entity, $field, $instance, $langcode, &$items) { foreach ($items as $delta => $item) { - if (empty($item['target_id']) && !empty($item['entity']) &&$item['entity']->isNew()) { + if (empty($item['target_id']) && !empty($item['entity']) && $item['entity']->isNew()) { $item['entity']->save(); $items[$delta]['target_id'] = $item['entity']->id(); }