Review main Merged

91548[TASK] Use `UrlFactory` for query generation in AjaxRequest

Andreas Nedbal CR +2 V +2 Easy +8 −9 updated 11/13/25, 11:56

Commit message

Switching the implementations here because InputTransformer
decodes properly encoded query arguments.

Review

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

Issues 2

Files 4

Review log 1520

  1. Andreas Nedbal uploaded patch set 1 11/11/25, 12:39

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

  3. Garvin Hicking commented on patch set 1 CR +1 V +1 11/11/25, 13:05

    lgtm :)
  4. Andreas Nedbal commented on patch set 1 CR -1 11/11/25, 13:12

    self-blocking because this is a potential high impact change that requires further reviews
  5. Andreas Nedbal uploaded patch set 2 CR +1 V +1 11/11/25, 15:02

  6. Andreas Nedbal uploaded patch set 3 11/11/25, 15:08

  7. core-ci voted on patch set 2 V +1 11/11/25, 15:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89023

  8. core-ci voted on patch set 3 V +1 11/11/25, 15:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89026

  9. Andreas Nedbal uploaded patch set 4 V +1 11/11/25, 15:25

  10. core-ci voted on patch set 4 V +1 11/11/25, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89030

  11. Garvin Hicking voted on patch set 4 CR +1 V +1 11/11/25, 20:58

  12. Benjamin Franzke commented on patch set 4 CR -1 11/12/25, 08:37

    ajax-request.ts:59

    This cast hides a real problem, that is otherwise reported by TypeScript: ``` Sources/TypeScript/core/ajax/ajax-request.ts:59:44 - error TS2345: Argument of type 'string | string[] | GenericKeyValue' is not assignable to parameter of type 'URLSearchParamsFeedable'. Type 'string[]' is not assignable to type 'URLSearchParamsFeedable'. Type 'string[]' is not assignable to type 'Record<string, NestedURLSearchParams>'. Index signature for type 'string' is missing in type 'string[]'. 59 data = UrlFactory.createSearchParams(data); ~~~~ ``` This means: That we unsupport passing a plain string to `withQueryArguments`. This should break `Sources/TypeScript/backend/tree/page-browser.ts` which does: ``` request = request.withQueryArguments('alternativeEntryPoints=' + encodeURIComponent(alternativeEntryPoints)); ``` This is a theoretical analysis, I haven't tested yet. But I'll -1 for now
  13. Andreas Nedbal commented on patch set 4 11/12/25, 08:52

    ajax-request.ts:59 Reply

    The problem is with string arrays, simple strings do work and are supported by `URLSearchParams`. Inside `UrlFactory.createSearchParams`: ``` if (typeof parameters === 'string') { return new URLSearchParams(parameters); } ``` We could implement support for flat string arrays utilizing a similar method as in InputTransformer, passing them as a string joined by & turns them into separate parameters once handled by `URLSearchParams`.
  14. Benjamin Franzke uploaded patch set 5 CR +1 V +1 11/12/25, 11:09

  15. Benjamin Franzke commented on patch set 5 11/12/25, 11:09

    ajax-request.ts:59 Reply

    Implemented support for string arrays.
  16. core-ci voted on patch set 5 V +1 11/12/25, 11:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89266

  17. Garvin Hicking commented on patch set 5 CR +1 V +1 11/13/25, 11:16

    This works for me with the described scenario. I do have one oddity where I enter a URI like: http://example.com/?query="odd"; in the link browser popup. That gets stored back as: http://example.com/?query=\"odd\"; Saving that will reveal the link again as `"odd"` and only when actively editing it, again showing `\"odd\"`. The frontend output however also strips the escape chars. I think this is beyond the scope of this patch but wanted to write down my finding.
  18. Benjamin Franzke commented on patch set 5 11/13/25, 11:34

  19. Benjamin Franzke voted on patch set 5 CR +2 V +2 11/13/25, 11:52

  20. Benjamin Franzke merged patch set 6 11/13/25, 11:56