73975[BUGFIX] Fix serialization of LazyLoadingProxy and LazyObjectStorage
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Oliver Klee +1
- Christian Kuhn +1
- Benni Mack +1
-
Verified V +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
- Benni Mack +1
- core-ci +1 CI
Issues 2
Files 5
- Build/phpstan/phpstan-baseline.neon+0 −5
- typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php+16 −0
- typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php7+19 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/LazyLoadingProxyTest.phpnew+75 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/LazyObjectStorageTest.phpnew+72 −0
Review log 4657
Show 2532 earlier messages
-
Alexander Schnitzler uploaded patch set 1 03/16/22, 09:40
-
Alexander Schnitzler wrote 03/16/22, 09:40
Topic set to extbase -
core-ci voted on patch set 1 V +1 03/16/22, 09:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24939
-
Sebastian Sebastian updated the commit message in patch set 2 03/16/22, 21:04
-
core-ci voted on patch set 2 V +1 03/16/22, 21:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24953
-
Alexander Schnitzler commented on patch set 2 03/31/22, 12:42
This change is ready for review. -
Oliver Klee voted on patch set 2 CR +1 03/31/22, 14:18
-
Oliver Klee updated the commit message in patch set 3 03/31/22, 14:19
-
Oliver Klee voted on patch set 3 CR +1 03/31/22, 14:19
-
core-ci voted on patch set 3 V +1 03/31/22, 14:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25309
-
Susi Moog voted on patch set 3 CR +1 04/04/22, 14:12
-
Stefan Bürk commented on patch set 3 07/07/22, 20:28
master => main Just asking ... should we really relay on the "old way" magic methods ? Or should we not better use the more newer and higher priorized "serialize()/unserialize()" methods adding to the classes, with corresponding \Serializeable interface for 11.5 and additionally corresponding __serialize/__unserialize methods on 10.4 ? (10.4 at all ?) -
Oliver Klee commented on patch set 3 CR 0 07/08/22, 09:32
We should also cover this with tests. I can do that, but it might take some time. -
Oliver Klee commented on patch set 3 07/08/22, 10:29
Reply
I'm all for using modern things (in this case: the interface), and AFAICS that wouldn't be breaking, i.e., we could also backport this to 10.4 without significant changes. -
Alexander Schnitzler rebased onto patch set 4 07/31/22, 08:35
-
core-ci voted on patch set 4 V +1 07/31/22, 08:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29741
-
Oliver Klee voted on patch set 4 CR +1 07/31/22, 09:20
-
Alexander Schnitzler uploaded patch set 5 07/31/22, 09:33
-
Oliver Klee voted on patch set 5 CR +1 07/31/22, 09:35
-
core-ci voted on patch set 5 V +1 07/31/22, 09:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29743
-
Oliver Klee voted on patch set 5 V +1 07/31/22, 09:41
-
Oliver Klee commented on patch set 5 CR 0 07/31/22, 10:00
LazyObjectStorage.php:324Should we also update these calls (and cover thee with tests)? -
Alexander Schnitzler uploaded patch set 6 07/31/22, 10:02
-
Alexander Schnitzler commented on patch set 6 07/31/22, 10:04
LazyObjectStorage.php:324ReplyDone -
Alexander Schnitzler commented on patch set 6 07/31/22, 10:06
FYI: I didn't implement \Serializable as I understand this interface is kind of deprecated or at least their methods serialize/unserialize in favor of the PHP 7.4+ magic methods __serialize/__unserialize. Not sure if I understand the direction, PHP goes into, completely. -
core-ci voted on patch set 6 V -1 07/31/22, 10:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29744
-
Alexander Schnitzler commented on patch set 6 07/31/22, 10:16
One question remains: If a LazyObjectStorage is already initialized, it pretty much acts as a regular ObjectStorage, containing not only the parent object for internal resolval but also all resolved objects. We could further reduce the footprint here by not serializing resolved objects and unserialize with a fresh state being: - storage - isModified - addedObjectsPositions - removedObjectsPositions - positionCounter - isInitialized reset to their default values. I am not sure yet if that is a good or bad idea. I guess it depends heavily on the circumstances those LazyObjectStorages are serialized. -
Alexander Schnitzler uploaded patch set 7 07/31/22, 10:32
-
Oliver Klee commented on patch set 7 07/31/22, 10:46
LazyObjectStorage.php:328We can combine these two into one unset call. -
Oliver Klee commented on patch set 7 07/31/22, 10:47
Reply
Makes sense. I’d prefer to move that optimization out of this bug fix, though, into a separate change. -
core-ci voted on patch set 7 V +1 07/31/22, 10:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29749
-
Alexander Schnitzler commented on patch set 7 07/31/22, 10:51
Reply
Ack
-
Alexander Schnitzler commented on patch set 8 07/31/22, 11:02
Published edit on patch set 7. -
core-ci voted on patch set 8 V +1 07/31/22, 11:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29752
-
Oliver Klee commented on patch set 8 V +1 CR +1 07/31/22, 11:16
LazyObjectStorage.php:328ReplyDone -
Simon Schaufelberger voted on patch set 8 V +1 CR +1 08/03/22, 16:34
-
Oliver Hader voted on patch set 8 CR +1 11/07/22, 20:15
-
Benni Mack updated the commit message in patch set 9 11/07/22, 22:43
-
Benni Mack voted on patch set 9 CR +1 11/07/22, 22:43
-
Benni Mack voted on patch set 9 V +1 11/07/22, 22:45
-
core-ci voted on patch set 9 V -1 11/07/22, 22:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33266
-
Stefan Bürk rebased onto patch set 10 11/08/22, 10:14
-
Christian Kuhn voted on patch set 10 CR +1 11/08/22, 10:25
-
core-ci voted on patch set 10 V -1 11/08/22, 10:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33287
-
Christian Kuhn commented on patch set 10 CR -1 11/08/22, 10:28
on it. -
Christian Kuhn uploaded patch set 11 11/08/22, 10:31
-
Christian Kuhn voted on patch set 11 V +1 CR +1 11/08/22, 10:33
-
Oliver Klee voted on patch set 11 CR +1 11/08/22, 10:36
-
core-ci voted on patch set 11 V +1 11/08/22, 10:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33290
-
Benni Mack voted on patch set 11 V +1 CR +1 11/08/22, 10:41
-
Stefan Bürk voted on patch set 11 V +2 CR +2 11/08/22, 10:48
-
Stefan Bürk merged patch set 12 11/08/22, 10:48
-
Oliver Hader commented on patch set 12 11/08/22, 10:49
LazyObjectStorage.php:336Note for a future follow-up on the PHP 8.2 dynamic property handling: Check existence of corresponding property before setting it. This can happen when data is unserialized in a changed code-base (e.g. property has been removed in between). -
Benjamin Franzke commented on patch set 12 11/08/22, 11:02
Unresolved
I don't think that this patch fixes the issue described in https://forge.typo3.org/issues/92148 – that one is about injected repositories, not about proxies. -
Alexander Schnitzler commented on patch set 12 02/19/23, 08:34
LazyObjectStorage.php:336ReplyThanks for the hint, can we achieve this with just `property_exists` here? -
Oliver Hader commented on patch set 12 05/14/25, 07:35
LazyObjectStorage.php:336ReplyI finally created a patch for that at https://review.typo3.org/c/Packages/TYPO3.CMS/+/89384