Review main Merged

93854[BUGFIX] Guard missing titleLen in backend user UC

Himanshu Nitsan CR +2 V +2 Easy +13 −1 updated 10/08/26, 16:42

Commit message

Several backend code paths accessed uc['titleLen'] directly and could trigger
"Undefined array key 'titleLen'" when the key is absent, escalating to
exception #1476107295 depending on error handling.

Apply defensive fallbacks in title length reads and use null-safe comparison
in setup processing to avoid warnings while keeping behavior unchanged.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Benni Mack +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1316

  1. Himanshu Nitsan uploaded patch set 1 04/27/26, 14:09

  2. Garvin Hicking commented on patch set 1 04/27/26, 14:12

    BackendUtility.php:1421

    I think we need to solve this differently; hardcoding the default values here is creating duplication and no longer having a "source of truth" for the initial value. Instead we'll have to somehow(tm) feed missing values on instantiation of `uc` into that object. Probably not only 'titleLen' is affected here.
  3. core-ci voted on patch set 1 V +1 04/27/26, 14:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101175

  4. Himanshu Nitsan commented on patch set 1 04/27/26, 14:20

    BackendUtility.php:1421 Reply

    Thanks for the feedback, before I update the patch, I’d like to confirm the approach. Instead of hardcoding fallback values in BackendUtility/GridColumnItem, I plan to normalize missing UC defaults centrally in BackendUserAuthentication::backendSetUC(). For existing non-empty UC records, this would backfill missing keys from uc_default + BE defaultUC + TSconfig setup.default, and persist the normalized UC. This should cover not only titleLen, but other missing UC keys as well. Does this approach look okay?
  5. Garvin Hicking commented on patch set 1 04/27/26, 14:33

    BackendUtility.php:1421 Reply

    I think it should be sufficient to fetch the defaults from the TCA defaults, rather keep it simple and stupid before you begin to evaluate TSconfig / TCADefaults. After a user has saved their UC once, the code should already align. And I believe the old defaults where also just inherited from ` $GLOBALS['TYPO3_USER_SETTINGS']`.
  6. Himanshu Nitsan commented on patch set 1 04/27/26, 15:08

    BackendUtility.php:1421 Reply

    I updated the patch set with the requested approach. Changes made: - Reworked the fix to backfill missing UC keys from UserSettingsSchema defaults in BackendUserAuthentication::backendSetUC(). - Removed the previous hardcoded fallback handling from call sites. I have used this: git commit --amend still it's create new one: https://review.typo3.org/c/Packages/TYPO3.CMS/+/93858
  7. Garvin Hicking commented on patch set 1 04/27/26, 15:23

    BackendUtility.php:1421 Reply

    You'll have to ensure your git working dir is "on this patch" (use the 3rd option in the "download" popup here for example). Then the "Change-Id" must be the same when you git commit, and the push will ammend your commit as a patchset here. Maybe you can try that, and then abandon the dupe? As for the solution, will have to investigate, might take me a bit of time.
  8. Himanshu Nitsan uploaded patch set 2 V +1 04/27/26, 15:31

  9. Himanshu Nitsan commented on patch set 2 04/27/26, 15:33

    BackendUtility.php:1421 Reply

    Yes, I will take care next time about the Change-Id.
  10. Himanshu Nitsan commented on patch set 2 04/27/26, 15:36

    BackendUtility.php:1421 Reply

    Done
  11. core-ci voted on patch set 2 V +1 04/27/26, 15:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101182

  12. Himanshu Nitsan rebased onto patch set 3 V +1 10/02/26, 06:58

  13. core-ci voted on patch set 3 V +1 10/02/26, 07:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109873

  14. Benni Mack voted on patch set 3 CR +1 V +1 10/02/26, 15:01

  15. Garvin Hicking voted on patch set 3 CR +2 V +2 10/02/26, 15:39

  16. Garvin Hicking merged patch set 4 10/08/26, 16:42