Review 13.4 Merged

94893[BUGFIX] Fix broken TableDiff::getDroppedForeignKeyConstraintNames()

Stefan Bürk CR +2 V +2 Normal +87 −3 updated 07/23/26, 08:06

Commit message

`TYPO3\CMS\Core\Database\Schema\TableDiff` extends the Doctrine
`TableDiff` and does not call the parent constructor by intention,
re-declaring all constructor properties as public to restore direct
property access. Doctrine declares them `private readonly`, so both
classes hold distinct properties of the same name.

All inherited getters are overridden accordingly, except
`getDroppedForeignKeyConstraintNames()` - added with Doctrine DBAL
4.4 as replacement for the deprecated `getDroppedForeignKeys()`. It
reads the Doctrine property directly, which is never initialized for
a TYPO3 `TableDiff`, raising:

  Error: Typed property Doctrine\DBAL\Schema\TableDiff::
  $droppedForeignKeys must not be accessed before initialization

Neither TYPO3 nor Doctrine DBAL 4.4 call the method yet, making the
defect latent. It becomes reachable when the schema managers switch
to the new API with Doctrine DBAL 5.0.

The method is overridden now, reading the re-declared property and
keeping the parent behaviour including the `InvalidState` exception
raised for unnamed dropped constraints. The `@deprecated` annotations
of the overridden methods `getModifiedIndexes()`,
`getModifiedForeignKeys()` and `getDroppedForeignKeys()` are adopted
from the parent, since overriding drops the inherited docblock and
with it the deprecation notice.

The inherited `getModifiedColumns()` and `getRenamedColumns()` are
not affected, both use the overridden `getChangedColumns()`.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 2

Files 2

Review log 34

  1. Stefan Bürk commented on patch set 1 07/23/26, 07:51

    Cherry Picked from branch 14.3.
  2. core-ci voted on patch set 1 V +1 07/23/26, 08:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105219

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 07/23/26, 08:06

  4. Stefan Bürk merged patch set 2 07/23/26, 08:06