diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php index 66888797f62985e45f1de7b7447cff0130e26f88..33989f3b22ca1edb8ae9edcc4d88cf1c73844cea 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php @@ -103,16 +103,18 @@ class LazyObjectStorage extends ObjectStorage implements LoadingStrategyInterfac */ protected function initialize() { - if (!$this->isInitialized) { - $this->isInitialized = true; - $objects = $this->dataMapper->fetchRelated($this->parentObject, $this->propertyName, $this->fieldValue, false); - foreach ($objects as $object) { - parent::attach($object); - } - $this->_memorizeCleanState(); - if (!$this->isStorageAlreadyMemorizedInParentCleanState()) { - $this->parentObject->_memorizeCleanState($this->propertyName); - } + if ($this->isInitialized) { + return; + } + + $this->isInitialized = true; + $objects = $this->dataMapper->fetchRelated($this->parentObject, $this->propertyName, $this->fieldValue, false); + foreach ($objects as $object) { + parent::attach($object); + } + $this->_memorizeCleanState(); + if (!$this->isStorageAlreadyMemorizedInParentCleanState()) { + $this->parentObject->_memorizeCleanState($this->propertyName); } }