Review main Ready for review

97197[BUGFIX] Avoid unbounded recursion in SuggestWizardDefaultReceiver

Johannes Schlier CR 0 V 0 Hard +358 −25 updated 11/16/26, 16:42

Commit message

queryTable() called itself until the call counter reached
maxItemsInResultList, even after all matching records were fetched,
and added the search constraints again on every call. A high
maxItemsInResultList with 50 or more matches exhausted memory.

Records are now fetched page by page in a loop that ends when a page is incomplete, enough records are collected or maxItemsInResultList + 1 pages are fetched, as before. The page access check is cached per page ID. The result keeps the sort order, so trimming to maxItemsInResultList removes the last records instead of the first.

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 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/97/97197/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/97/97197/2 && 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 1

Issues 1

Files 4

Review log 35

  1. Johannes Schlier uploaded patch set 1 10/28/26, 15:10

  2. core-ci voted on patch set 1 V +1 10/28/26, 15:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112728

  3. Oli Bartsch commented on patch set 1 10/28/26, 18:32

    SuggestWizardDefaultReceiver.php:180 Unresolved

    the loop now only ends on an incomplete page or once `maxItems` records are accepted. For non-pages tables, access is only checked in PHP per row, so a restricted editor searching a table with many matches (e.g. `tt_content`) can trigger thousands of SELECTs per keystroke. Please keep a page cap as a second exit next to the fetched-rows condition, e.g. stop after `maxItems + 1` pages as before. Memoizing `readPageAccess()` per pid would be a nice extra.

    SuggestWizardDefaultReceiverTest.php:48 Unresolved

    both tests run as admin, so `checkRecordAccess()` never rejects a row. Would be goo to have at least one non-admin test, where the first 50+ matches are inaccessible and later accessible ones must still be returned, plus one that checks scanning stops at the cap.
  4. Johannes Schlier uploaded patch set 2 V +1 11/16/26, 16:36

  5. core-ci voted on patch set 2 V +1 11/16/26, 16:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114638