Bug #88613

Replace ObjectStorage & LazyObjectStorage with symfony/collection

Added by Oliver Hader about 1 month ago. Updated 9 days ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2019-06-21
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

For regular ObjectStorage deserialization most probably would work - however there are inconsitencies concerning object integrity due to ObjectStorage using spl_object_hash() internally. In a result it would not be possible to detach an object retrieved from repository from some deserialized ObjectStorage - basically uid should be used as identifier here which would turn ObjectStorage into EntityStorage. So, we could live with serialization of ObjectStorage.

For LazyObjectStorage things are getting more difficult since serialization of it would mean to serialize backreferences to parent object as well as DataMapper state, ObjectManager state and in the end class Reflection state - that turns out to be a massive collection of serialized data.

Thus, we experience most pain with LazyObjectStorage and its current implementation.

History

#1 Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61118

#2 Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61118

#3 Updated by Gerrit Code Review 30 days ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61118

#4 Updated by Oliver Hader 9 days ago

  • Description updated (diff)

#5 Updated by Oliver Hader 9 days ago

@Alexander Schnitzler (https://review.typo3.org/c/Packages/TYPO3.CMS/+/61118/3#message-e5ec8c4a56d55a65395753969b7d240c8effc6cb)

I am planning to replace our ObjectStorage with doctrine/collection anyway. That also means, that our Lazy-Objects won't be used any more. The Collection also doesn't have any services injected, its state is handled from the outside. So, if we don't have issues with people trying to serialize their object storages at the moment, I'd say, let's abandon this patch and work on a better implementation.

#6 Updated by Oliver Hader 9 days ago

  • Subject changed from Properly deny serialization of Extbase object storage to Substitute ObjectStorage & LazyObjectStorage with symfony/collection
  • Status changed from Under Review to Accepted

#7 Updated by Oliver Hader 9 days ago

  • Subject changed from Substitute ObjectStorage & LazyObjectStorage with symfony/collection to Replace ObjectStorage & LazyObjectStorage with symfony/collection

Also available in: Atom PDF