Skip to content

Release 5.0.0 cli fixes - #151

Open
Mainbird wants to merge 2 commits into
sourcebroker:release/5.0.0from
move-elevator:release-5.0.0-cli-fixes
Open

Release 5.0.0 cli fixes#151
Mainbird wants to merge 2 commits into
sourcebroker:release/5.0.0from
move-elevator:release-5.0.0-cli-fixes

Conversation

@Mainbird

@Mainbird Mainbird commented Aug 5, 2026

Copy link
Copy Markdown

Fix route enhancer failures during CLI sub-requests (e.g. EXT:solr v14 indexing)

When TYPO3's route matching runs inside a CLI context — such as EXT:solr v14 page indexing,
which triggers a sub-request without a real HTTP request URL —
ServerRequestFactory::fromGlobals() throws InvalidRequestUrlOnCliException. This happened
because SiteService::getResolvedByTypo3() unconditionally called it while trying to resolve the
current site.

This surfaced downstream in ResourceEnhancer::enhanceForMatching(): getBasePath() depends on the
current site being resolvable, so the exception propagated and broke route matching for the
entire request — not just the T3api routes.

Changes

  • Classes/Routing/Enhancer/ResourceEnhancer.php: wrap getBasePath() in enhanceForMatching() in a
    try/catch — if the base path can't be resolved (no current site), skip T3api enhancement for
    that request instead of throwing. The API routes are irrelevant in that case anyway.
  • Classes/Service/SiteService.php: no net change — this was addressed directly in the enhancer
    instead, since catching there covers the failure at its actual point of impact.

Testing

Verified route matching no longer throws during a CLI sub-request lacking a request URL, while
normal HTTP request handling is unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants