Issue Feature Resolved

#110269Allow row updater registration with PHP attribute

Stefan Bürk 07/22/26, 17:12 updated 08/31/26, 21:30

Description

Row updaters implementing TYPO3\CMS\Core\Upgrades\RowUpdater\RowUpdaterInterface
are executed by the databaseRowsUpdateWizard upgrade wizard. It iterates over
all rows of all TCA tables once and hands each row to every registered row
updater which announced a potential update for the table, which makes them the
tool of choice for data migrations that cannot be expressed as a plain SQL
statement.

Until now the list of row updaters was a hard-coded, TYPO3 Core internal
property of TYPO3\CMS\Core\Upgrades\DatabaseRowsUpdateWizard. Extension and
project developers had no supported way to ship their own implementation.

Expected

  • A new PHP attribute TYPO3\CMS\Core\Attribute\AsRowUpdater registers a class
    implementing RowUpdaterInterface as row updater.
  • The attribute takes an optional identifier, which falls back to the fully
    qualified class name when omitted.
  • Manual registration with the install.rowupdater service tag stays possible,
    for cases where the class cannot carry the attribute.

Details

  • RowUpdaterRegistry receives the tagged services as a lazy ServiceLocator
    indexed by identifier, so only row updaters that still need to run are
    instantiated.
  • RowUpdaterService combines the registry with the executed state kept in the
    system registry (installUpdateRows/rowUpdatersDone).
  • DatabaseRowsUpdateWizard and UpgradeWizardsService address row updaters by
    identifier instead of instantiating class names read from the system registry.
    The identifier must therefore be unique and stable once a row updater has been
    executed.
  • Both receive their dependencies through constructor injection, dropping the
    remaining GeneralUtility::makeInstance() calls in that code path.

Continues the work of the parent epic to allow shipping upgrade wizards without
requiring EXT:install (#106947).

Reviews 1

Files 1

History 39

  1. Gerrit Code Review pushed patch set 12 for main to change 91662 status New Under Review <span data-processor="relativetime" data-value="2026-07-22T17:47:17+00:00" > 07/22/26, 17:47 </span>

  2. Stefan Bürk commented and changed attached test_rowupdater.zip <span data-processor="relativetime" data-value="2026-08-14T13:51:10+00:00" > 08/14/26, 13:51 </span>

    Example extension for the row updater registration

    Attached “test_rowupdater.zip” is a minimal example extension, used to verify
    this change in a real installation instead of only through the functional test
    fixtures.

    Why it is uploaded here and not shipped with the change: the functional test
    fixtures below EXT:core are not meant to be installed in a running system, and
    they only cover the registration itself. Reviewers, however, need something
    they can drop into “typo3conf/ext” to walk through the complete flow once,
    including the schema change and the wizard execution. Keeping that example in
    the issue, rather than in the patch, keeps the change free of code which is of
    no use for a shipped TYPO3 installation.

    What the extension contains:

    • a “pages” TCA override adding the read only, not required input field
      “rowupdater_identifier”
    • one row updater, registered with the new “AsRowUpdater” attribute, which
      fills that field with “rowupdater_” plus the page uid for every “pages” row
      still having an empty value, and only when the field really exists in the
      database

    How to use it: unpack below “typo3conf/ext”, activate the extension, run the
    extension setup, and afterwards execute the “databaseRowsUpdateWizard” upgrade
    wizard.

    The change has been verified with this extension in the backend module of the
    install tool, in the standalone install tool, and on the command line.

  3. Stefan Bürk commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-08-31T21:30:09+00:00" > 08/31/26, 21:30 </span>

    Applied in changeset commit:d8c1db1e3847e6d076c0878b3a913cb93f0c8931.