Issue Task Under Review

#111136Move Extbase dirty tracking from the entity into the persistence layer

Alexander Schnitzler 10/18/26, 19:48 updated 11/11/26, 08:24

Description

Extbase domain objects keep their own clean state and answer whether
they have been modified: _memorizeCleanState(), _isDirty(),
_getCleanProperties() and friends live in AbstractDomainObject and in
ObjectMonitoringInterface, which ObjectStorage implements as well.
The persistence layer asks the entity for its own state.

This mixes 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 and computes change sets
outside of the entity.

Plan (breaking, main only):

  • A new CleanStateTracker in the persistence layer keeps the original
    values per object and answers the dirty questions. 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 the tracker.
  • The entity methods _memorizeCleanState(), _memorizePropertyCleanState(),
    _getCleanProperties(), _getCleanProperty(), _isDirty(), _isClone(),
    _setClone() and ObjectMonitoringInterface are removed, as well as
    _memorizeCleanState() and _isDirty() on ObjectStorage.
  • An object the tracker does not know, for example an unserialized or
    cloned entity, is not managed anymore: update() of such an object
    with a uid throws an exception instead of writing relations twice.
    Fetch the object from the repository (or let the property mapper
    convert its identity) and apply the changes before updating it.
  • The tracker is offered as replacement. It is marked @internal and
    only promised for TYPO3 v15, as its shape may change with the move
    towards Doctrine ORM.

Public extensions using the removed methods (femanager, sf_event_mgt,
cart, headless) are covered by migration examples in the Breaking
changelog.

Reviews 1

History 17