Skip to content

[BUGFIX] Skip languages absent on a resolved site for queued page item#4677

Open
amirarends wants to merge 1 commit into
TYPO3-Solr:mainfrom
amirarends:topic/4675-cross-site-language-filter
Open

[BUGFIX] Skip languages absent on a resolved site for queued page item#4677
amirarends wants to merge 1 commit into
TYPO3-Solr:mainfrom
amirarends:topic/4675-cross-site-language-filter

Conversation

@amirarends

@amirarends amirarends commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What this pr does

In IndexingService::getPageSolrConnections(), intersect the connection list with the languages defined on the page's own site fetched via SiteFinder::getSiteByPageId() before returning it. Languages that the site of queue item advertises but the site of the page does not provide are filtered out. When at least one language gets dropped, the new code logs an info entry with the queue item UID, the queue item's root page UID, the page's site identifier, and the dropped language IDs. If the page does not resolve to any site SiteNotFoundException, the filter falls back to returning the unfiltered list, preserving the existing downstream failure mode rather than masking it here.

How to test

Provided functional tests sets up two nested sites that share the same Solr backend:

  • outer site, root page 1, languages EN/DE/DA, DE+DA with EN fallback, all Solr-enabled
  • inner site, root page 2 nested at pid=1, language EN only

The fixture pre-seeds a queue item against the outer root for a page that physically lives in the inner tree.
After running IndexService->indexItems(), the test asserts:

  • the queue item's errors column stays empty and indexed is greater than 0
  • core_en received the page
  • core_de and core_da did not receive the page

Without the filter, the queue item's indexed stays 0, because indexPageItem() returns false after the caught DE/DA exceptions, which the test catches.

Fixes: #4675

@amirarends
amirarends force-pushed the topic/4675-cross-site-language-filter branch 6 times, most recently from 4ccd658 to 2986c18 Compare June 5, 2026 05:01
@amirarends amirarends changed the title [BUGFIX] Skip cross-site indexing for languages absent on the page's resolved site [BUGFIX] Skip languages absent on a resolved site for queued page item Jun 5, 2026
@amirarends

Copy link
Copy Markdown
Contributor Author

@dkd-kaehm I have reworked this PR. After thinking through your feedback and the alternatives, i have landed on the smallest possible change that resolves the reported failure mode: IndexingService::indexPageItem() now pre-checks each language against the resolved site using Site::getLanguageById(). When the site does not configure that UID, the iteration is skipped cleanly with an info log. No failed sub-request, no error trail, and the queue item completes across the languages that actually apply and gets its indexed timestamp.

On reflection, how nested-site pages should be routed through the queue is a EXT:solr architecture discussion, not a bugfix scope. There are legitimate setups (shared corporate pagetrees with country/market subsites being one of them) where a single conceptual answer does not fit everyone. 👍

@dkd-kaehm
dkd-kaehm force-pushed the topic/4675-cross-site-language-filter branch from 2986c18 to 8e283fc Compare June 17, 2026 03:50
@dkd-kaehm
dkd-kaehm force-pushed the main branch 4 times, most recently from 0c90549 to 365cf5c Compare June 17, 2026 07:09
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.

[BUG] IndexQueue: "Language X does not exist on site Y"

1 participant