Review main Merged

96848[BUGFIX] Persist lazy relations assigned from another object

Alexander Schnitzler CR +2 V +2 Normal +158 −1 updated 10/28/26, 16:01

Commit message

Assigning the uninitialized lazy proxy of a to-one relation to
another object does not write the relation. For example
$blog1->setAdministrator($blog3->getAdministrator()) followed by
update() and persistAll() leaves the administrator of blog 1 at 0.
With an already initialized proxy the relation is written.

Backend::persistObject() skips every value for which
propertyValueIsLazyLoaded() is true before it checks whether the
property is dirty. A proxy that was taken from another object is
therefore never compared with the stored value of the target
object and the new relation is dropped.

A lazy value is now only skipped if the property is not dirty,
that is if it is still the untouched lazy value of the object
itself. An assigned proxy differs from the clean state, so it is
persisted as the uid of the related record. Tests cover the
uninitialized and the initialized proxy, a new object and the
object the proxy was taken from.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 810

  1. Alexander Schnitzler uploaded patch set 1 10/19/26, 06:39

  2. core-ci voted on patch set 1 V -1 10/19/26, 06:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111580

  3. Alexander Schnitzler uploaded patch set 2 V -1 10/19/26, 06:55

  4. core-ci voted on patch set 2 V +1 10/19/26, 07:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111583

  5. Alexander Schnitzler marked it ready for review 10/19/26, 07:11

  6. Alexander Schnitzler wrote 10/19/26, 07:13

    Topic set to extbase
  7. Oliver Klee voted on patch set 2 V +1 10/19/26, 20:48

  8. Simon Schaufelberger voted on patch set 2 CR +1 V +1 10/22/26, 19:15

  9. Benni Mack voted on patch set 2 CR +2 V +2 10/28/26, 16:01

  10. Benni Mack merged patch set 3 10/28/26, 16:01