Review main Ready for review Stale

93780[BUGFIX] Mitigate missing `user_settings` field during CLI bootstrap

Stefan Bürk CR 0 V 0 Normal +39 −17 updated 06/16/26, 09:42

Commit message

Change #108832 introduced the new field `be_users.user_settings`
to migrate user settings from PHP-serialized data to JSON,
The change comes with an upgrade wizard to migrate
all user settings at once.

However, running `bin/typo3 extension:setup` is a common upgrade
step used to create missing database tables and fields. The CLI
bootstrap relies on `CommandLineUserAuthentication`, which may
attempt to write user settings early, even before the field has been
added to the database. This leads to

> `Doctrine\DBAL\Exception\InvalidFieldNameException
> Unknown column 'user_settings' in 'field list'`

`BackendUserAuthentication::writeUC()` now verifies that
`be_users.user_settings` exists using cached database schema
information, and writes to it only if the field exists.

Cached schema information is used intentionally because the method
is called frequently during normal backend operations.

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 8
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/80/93780/8 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/80/93780/8 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 3

Issues 2

Files 1

Review log 1320

  1. Stefan Bürk uploaded patch set 1 04/21/26, 12:26

  2. Stefan Bürk updated the commit message in patch set 2 04/21/26, 12:32

  3. Stefan Bürk uploaded patch set 3 04/21/26, 12:34

  4. core-ci voted on patch set 1 V +1 04/21/26, 12:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100640

  5. core-ci voted on patch set 3 V +1 04/21/26, 12:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100642

  6. core-ci voted on patch set 2 V +1 04/21/26, 13:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100641

  7. Stefan Bürk updated the commit message in patch set 4 V +1 04/21/26, 13:40

  8. Stefan Bürk commented on patch set 4 04/21/26, 13:40

    This change is ready for review.
  9. core-ci voted on patch set 4 V +1 04/21/26, 13:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100643

  10. Anja Leichsenring updated the commit message in patch set 5 V +1 04/21/26, 13:53

  11. core-ci voted on patch set 5 V +1 04/21/26, 14:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100644

  12. Benni Mack commented on patch set 5 04/21/26, 14:02

    BackendUserAuthentication.php:2017

    I think we can simply do this by checking `if (isset($this->user['user_settings']))` so we do not need a DB roundtrip
  13. Stefan Bürk commented on patch set 5 04/21/26, 14:14

    BackendUserAuthentication.php:2017 Reply Unresolved

    Using the cached information (files) should not hurt that much, it would be used in the update() under the hood anyway. ``` BackendUserAuthentication::resetUC() ``` sets user_setting to an empty string - should not be "called" in that chain and therefore possible be safe (for now). Using the cached db information would be the safe way. What do you think ? @benni@typo3.org
  14. Stefan Bürk updated the commit message in patch set 6 V +1 04/21/26, 14:15

  15. core-ci voted on patch set 6 V +1 04/21/26, 14:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100645

  16. Benni Mack updated the commit message in patch set 7 V +1 04/22/26, 07:19

  17. Benni Mack rebased onto patch set 8 05/11/26, 14:53

  18. core-ci voted on patch set 8 V +1 05/11/26, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101836

  19. Oliver Klee commented on patch set 8 05/19/26, 12:09

    Should we cover this with a functional test?
  20. Benjamin Franzke commented on patch set 8 06/16/26, 09:42

    BackendUserAuthentication.php:2236 Unresolved

    I guess you catch because the database might be unavailable? Can we be more concrete, as we should avoid catching `Throwable` generically.