Review main Ready for review

90855[BUGFIX] Ensure record within context menu record providers is an array

Elias Häußler CR +1 V +1 Easy +1 −1 updated 11/13/26, 12:57

Commit message

On system root pages (uid=0), no page record exists and thus, the
appropriate record query returns null. When assigning this to the
`$record` property of context menu record providers, this now falls back
to an empty array instead, in order to make sure it's always an array,
streamlining this behavior with the already existing `$pageRecord`
property assignment.

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

Review

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

Merge conflicts 1

Issues 1

Files 1

Review log 1215

  1. Elias Häußler uploaded patch set 1 10/01/25, 10:05

  2. core-ci voted on patch set 1 V +1 10/01/25, 10:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85798

  3. Oliver Klee voted on patch set 1 CR +1 10/01/25, 14:27

  4. Oliver Klee commented on patch set 1 10/01/25, 14:28

    Can we cover this with a (functional) test?
  5. Benni Mack commented on patch set 1 CR +1 V +1 10/01/25, 15:07

    I wonder why phpstan didn't detect this.
  6. Oliver Klee commented on patch set 1 10/01/25, 15:30

    Reply

    Educated guess: This might be due to the PHPStan level we're currently at (level 6).
  7. Oli Bartsch commented on patch set 1 CR +1 V +1 10/01/25, 15:59

    Reply

    Hi, I'm not quite sure what we could test here. getRecordWSOL() returns ?array. So using `?? []` does always lead to $this->record being an array. I think this patch is fine this way. However, I will not merge yet to allow you adjustments, if you like.
  8. Oliver Klee commented on patch set 1 10/01/25, 16:12

    Reply Unresolved

    > I'm not quite sure what we could test here. I was thinking along the lines of a regression test, i.e., a test that fails without the fix and that passes with it. I don't know the code well enough to come up with a scenario (including calls) where this bug might get triggered, though. @elias@haeussler.dev Do you happen to know which calls could trigger this bug?
  9. Garvin Hicking commented on patch set 1 10/01/25, 18:58

    Unresolved

    I'm afraid this fix may have follow-up errors. While creating a functional test I saw that the whole provider for example directly accesses `$this->record['pid']` in for example `initializePermissions()` which does not check the array for a valid key. That method is called via `initialize()` directly. So there would be more to do to gate this method against a missing page object I believe. Please see https://review.typo3.org/c/Packages/TYPO3.CMS/+/90859 for the test I tried to setup. You can also search for usages of $this->record in RecordProvider or PageProvider to see that there are various instances of direct access to $record. Too tired for now to think of a solution, but wanted to share my finding.
  10. Benni Mack wrote 04/21/26, 15:02

    Removed reviewer Benni Mack with the following votes: * Verified+1 by Benni Mack * Code-Review+1 by Benni Mack
  11. Benni Mack updated the commit message in patch set 2 CR +1 V +1 04/22/26, 06:54

  12. core-ci voted on patch set 2 V -1 04/22/26, 11:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100825

  13. Benni Mack rebased onto patch set 3 V -1 10/02/26, 06:59

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

  15. Georg Ringer voted on patch set 3 CR +1 V +1 11/13/26, 12:57