Review main Merged

95779[TASK] Decouple file storage consumers from the sys_file_storage table

Benni Mack CR +2 V +2 Hard +404 −429 updated 09/20/26, 18:26

Commit message

Several places outside the FAL API talk to the sys_file_storage
table directly. They now go through StorageRepository, so the
storage definitions can move out of the database later on:

* sys_file.storage and tx_scheduler_task.file_storage get their
  select items from the new items processor function
  TcaItemsProcessorFunctions->populateFileStorages(), which lists
  the storages of the backend user, instead of a foreign_table.
  Both columns are declared in ext_tables.sql, as a select field
  with an itemsProcFunc gets no derived integer column.
* Read-only file mounts from user TSconfig resolve the default
  storage via StorageRepository->getDefaultStorageUid() instead of
  a direct query. The method resolves the uid without instantiating
  a storage, which would apply the mounts before they are complete.
* cleanup:localprocessedfiles determines the local storages via the
  repository instead of joining the table. This also removes the
  duplicate records reported when several local storages exist.

Without the foreign_table, the reference index no longer records
the relation of a sys_file record to its storage. Fixtures are
adjusted accordingly. EXT:impexp adds this relation on export, so
exports still contain the storage records the import needs to map
files to an equivalent storage of the target system.

Review

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

Issues 1

Files 154

Show 134 more files

Review log 1317

  1. Benni Mack uploaded patch set 1 09/11/26, 23:05

  2. core-ci voted on patch set 1 V -1 09/11/26, 23:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108364

  3. Benni Mack rebased onto patch set 2 V -1 09/14/26, 09:42

  4. core-ci voted on patch set 2 V +1 09/14/26, 09:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108506

  5. Benni Mack marked it ready for review 09/14/26, 10:19

  6. Benni Mack uploaded patch set 3 V +1 09/14/26, 13:51

  7. core-ci voted on patch set 3 V +1 09/14/26, 13:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108534

  8. Stefan Bürk commented on patch set 3 CR -1 09/15/26, 09:46

    On it ....
  9. Stefan Bürk uploaded patch set 4 CR -1 V +1 09/15/26, 16:31

  10. Stefan Bürk commented on patch set 4 09/15/26, 16:31

    Rebased, and on top of patchset 3 I did following. I would say see the patchset diff, but I guess that will be pullated because of the rebase. * **impexp**: `Export::exportAddRecord()` adds the `sys_file` → `sys_file_storage` relation by hand, like the existing `l10n_source` workaround. Without it, new exports lost the storage records, and the import put all files into the target's storage 1 instead of mapping them to an equivalent storage (proven with `images-with-storages.xml` stripped of its storage records). The PS3 impexp fixture changes are reverted; the existing export fixtures cover the relation. * `populateFileStorages()` returns early without a backend user, since `SchemaLabelResolver` / `getProcessedValue()` now call it too. Dropped the unused `getBackendUser()`. * Tests: * `TcaItemsProcessorFunctionsFileStoragesTest` with real admin and editor users, including an unregistered driver. * `getDefaultStorageUid()` in `StorageRepositoryTest`, plus the empty-storage-table case for read-only mounts. * `--all` keeps the records of non-local storages. * `$GLOBALS['BE_USER']` is now reset in `TcaItemsProcessorFunctionsTest`. * Changelog: * Dropped the impexp bullet and the table-permission remark. * Added the scheduler task refindex rows with the `referenceindex:update` hint, the user-dependent labels, the `StaticSelectFieldType` / Record API change, and the auto-created default storage. * Index line with ext:scheduler and ext:lowlevel. * Adjusted the commit message impexp paragraph.
  11. core-ci voted on patch set 4 V +1 09/15/26, 16:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108632

  12. Benni Mack commented on patch set 4 09/17/26, 20:58

    Reply

    Done
  13. Georg Ringer voted on patch set 4 CR +1 V +1 09/17/26, 21:09

  14. Stefan Bürk commented on patch set 4 CR -1 09/20/26, 14:19

    On it ...
  15. Stefan Bürk voted on patch set 4 CR +2 V +2 09/20/26, 18:26

  16. Stefan Bürk commented on patch set 4 09/20/26, 18:26

    Reply

    Done
  17. Stefan Bürk merged patch set 5 09/20/26, 18:26