Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review Breaking

96845[!!!][TASK] Move Extbase dirty tracking into the persistence layer

Alexander Schnitzler CR +1 V +1 Expert +2009 −338 updated 11/15/26, 01:06

Commit message

Extbase domain objects kept their own clean state and answered
whether they had been modified. This mixed persistence concerns into
the domain model and stands in the way of moving the Extbase
persistence towards Doctrine ORM, where the UnitOfWork keeps the
original entity data outside of the entity.

The new CleanStateTracker keeps the original values per object in a
WeakMap. Its method names follow the UnitOfWork concepts: original
entity data, original entity property, entity change set. DataMapper,
Backend, the lazy loading classes, ExtbaseHistoryTracker,
DebuggerUtility and the Fluid form ViewHelpers use it.

The entity methods _memorizeCleanState(),
_memorizePropertyCleanState(), _getCleanProperties(),
_getCleanProperty(), _isDirty(), _isClone(), _setClone() and the
ObjectMonitoringInterface are removed, as well as
_memorizeCleanState() and _isDirty() on ObjectStorage.
AbstractDomainObject::__clone() is removed as well, as clones are
no longer tracked.

An object with a uid the tracker does not know, for example an
unserialized or cloned entity, is not managed. add() and update() of
such an object, and persisting a graph that reaches one, throw an
UnmanagedObjectException before anything is written, instead of
overwriting records or writing relation rows twice.

The tracker is the replacement for the removed methods. It is marked
internal and only offered for TYPO3 v15.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 6
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/45/96845/6 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/45/96845/6 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Oliver Klee +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 40

Show 20 more files

Review log 1925

  1. Alexander Schnitzler uploaded patch set 1 10/18/26, 20:07

  2. core-ci voted on patch set 1 V +1 10/18/26, 20:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111561

  3. Alexander Schnitzler marked it ready for review 10/18/26, 20:21

  4. Alexander Schnitzler wrote 10/18/26, 20:21

    Topic set to extbase
  5. Alexander Schnitzler uploaded patch set 2 V +1 10/19/26, 04:59

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

  7. Oliver Klee voted on patch set 2 V +1 10/19/26, 17:22

  8. Simon Schaufelberger commented on patch set 2 10/20/26, 17:31

    CleanStateTracker.php:170

    "that is simply too much" is not a very clear message imo. Could this improved so that it becomes clearer to understand what is "too much"? I know this message was copied but was not good in the first place.
  9. Alexander Schnitzler commented on patch set 2 10/20/26, 17:48

    CleanStateTracker.php:170 Reply

    Well, I always took it for a rather comical comment. Not sure if we actually need a better message here but it could be more technical like `The uid of the persisted object of class "%s" was changed from "%s" to "%s". Changing the uid of a persisted object is not supported.`
  10. Simon Schaufelberger commented on patch set 2 10/20/26, 19:12

    CleanStateTracker.php:170 Reply

    I would be happy with this technical exception message.
  11. Alexander Schnitzler uploaded patch set 3 V +1 10/29/26, 10:42

  12. core-ci voted on patch set 3 V +1 10/29/26, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112794

  13. Alexander Schnitzler commented on patch set 3 10/29/26, 12:04

    This change is ready for review.
  14. Oliver Klee voted on patch set 3 V +1 10/29/26, 13:33

  15. Simon Schaufelberger commented on patch set 3 CR +1 V +1 10/29/26, 15:59

    CleanStateTracker.php:170 Reply

    Done
  16. Alexander Schnitzler uploaded patch set 4 CR +1 V +1 11/04/26, 08:55

  17. core-ci voted on patch set 4 V +1 11/04/26, 09:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113261

  18. Oliver Klee voted on patch set 4 V +1 11/04/26, 11:51

  19. Simon Schaufelberger voted on patch set 4 CR +1 V +1 11/04/26, 14:13

  20. Markus Klein uploaded patch set 5 CR +1 V +1 11/10/26, 08:13

  21. core-ci voted on patch set 5 V -1 11/10/26, 08:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113858

  22. Alexander Schnitzler uploaded patch set 6 V -1 11/11/26, 08:24

  23. core-ci voted on patch set 6 V +1 11/11/26, 08:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114020

  24. Oliver Klee voted on patch set 6 V +1 11/11/26, 08:38

  25. Simon Schaufelberger voted on patch set 6 CR +1 V +1 11/15/26, 01:06