Review main Merged

92573[TASK] Ensure ContentObjectRenderer state contains only scalar values

Oliver Hader CR +2 V +2 Hard +357 −3 updated 04/13/26, 16:39

Commit message

The `lastTypoLinkResult` in ContentObjectRenderer::getState() was
previously stored as an object reference. This change converts it
to a scalar array representation for proper serialization.

Introduces LinkResultStateInterface with getState()/fromState()
methods, implemented by LinkResult. The new LinkResultService
handles the conversion between object and state array.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Christian Kuhn +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Christian Kuhn +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 2227

Show 12 earlier messages
  1. Oliver Hader uploaded patch set 1 01/29/26, 12:58

  2. core-ci voted on patch set 1 V +1 01/29/26, 13:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94570

  1. Oliver Hader commented on patch set 1 01/29/26, 13:08

    This change is ready for review.
  2. Benni Mack voted on patch set 1 CR +1 01/29/26, 17:25

  3. Benni Mack voted on patch set 1 V +1 01/30/26, 16:18

  4. Benni Mack commented on patch set 1 01/30/26, 16:19

    LinkResult.php:63

    I would feel better if we just use "new"
  5. Oliver Hader commented on patch set 1 01/30/26, 16:40

    LinkResult.php:63 Reply

    Fine, I'll change that in a few minutes...
  6. Oliver Hader commented on patch set 1 CR -1 01/30/26, 16:41

    On it. I'm also adding a test for the new service...
  7. Oliver Hader uploaded patch set 2 CR +1 V +1 01/30/26, 17:07

  8. Oliver Hader commented on patch set 1 CR -1 01/30/26, 17:07

    Reply

    Done
  9. Oliver Hader commented on patch set 2 01/30/26, 17:10

    https://review.typo3.org/c/Packages/TYPO3.CMS/+/92594 is now a prerequisite for this patch. I think this array utility might be handy for other occurrences as well.
  10. core-ci voted on patch set 2 V +1 01/30/26, 17:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94689

  11. Oliver Hader rebased onto patch set 3 V +1 01/30/26, 20:53

  12. core-ci voted on patch set 3 V +1 01/30/26, 21:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94709

  13. Benni Mack voted on patch set 3 CR +1 V +1 02/01/26, 09:18

  14. Oliver Hader rebased onto patch set 4 CR +1 V +1 04/13/26, 14:52

  15. Christian Kuhn commented on patch set 4 CR -1 04/13/26, 14:59

    on it.
  16. core-ci voted on patch set 4 V +1 04/13/26, 15:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100086

  17. Christian Kuhn commented on patch set 4 CR 0 04/13/26, 15:08

    LinkResultStateInterface.php:21

    let's declare the interface @internal as well: i think we could avoid 'lastTypolinkResult' in v15 altogether without too much hassle, which could eventually obsolete the entire construct altogether again, if no further reasons pop up that make it useful.
  18. Oliver Hader uploaded patch set 5 V +1 04/13/26, 15:56

  19. Oliver Hader commented on patch set 5 04/13/26, 15:57

    LinkResultStateInterface.php:21 Reply

    Done
  20. Christian Kuhn commented on patch set 5 CR +1 V +1 04/13/26, 15:57

    LinkResultStateInterface.php:21 Reply

    thx!
  21. Benni Mack voted on patch set 5 CR +1 V +1 04/13/26, 15:59

  22. core-ci voted on patch set 5 V +1 04/13/26, 16:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100090

  23. Oliver Hader voted on patch set 5 CR +2 V +2 04/13/26, 16:24

  24. Oliver Hader merged patch set 6 04/13/26, 16:24

  25. Ayke Halder commented on patch set 5 04/13/26, 16:39

    Unresolved

    In general: Might we make use of Symfony components for the `getState` and `fromState` implementation? See https://symfony.com/doc/current/serializer.html#serializing-to-or-from-php-arrays ```php use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class PersonController extends AbstractController { public function index(DenormalizerInterface&NormalizerInterface $serializer): Response { $person = new Person('Jane Doe', 39, false); // use normalize() to convert a PHP object to an array $personArray = $serializer->normalize($person, 'json'); // ...and denormalize() to convert an array back to a PHP object $personCopy = $serializer->denormalize($personArray, Person::class); } } . ```

    ContentObjectRenderer.php:430 Unresolved

    Is this still true?