#110210LinkValidator Scheduler ignores configured languages when checking and counting broken links
Description
Problem
The LinkValidator Scheduler task does not apply the configured language restriction when checking and counting broken links.
The language restriction is only applied when the detailed list of broken links is fetched. This can produce an inconsistent email report:
- The summary reports one or more broken links.
- The detailed broken-link list is empty.
- A notification email can be sent although no broken link exists in any of the configured languages.
Steps to reproduce
- Set up a TYPO3 installation with EXT:linkvalidator and EXT:scheduler.
- Configure at least two site languages:
- Default language with language ID
0 - A second language with language ID
1
- Default language with language ID
- Create a visible page in the default language.
- Create a content element on that page in language
0. - Add an internal link from that content element to another page.
- Delete the linked target page so that the link becomes broken.
- Create a LinkValidator Scheduler task with:
- The created page as start page
- Depth
0 - Languages to search for broken links:
1 - A valid email recipient
- Execute the Scheduler task.
Actual result
The broken link from the default-language record with sys_language_uid = 0 is checked and included in newBrokenLinkCounts, even though only language 1 is configured.
When the detailed broken links are fetched, the language filter is applied and the default-language link is excluded.
The resulting data is inconsistent:
$newBrokenLinkCounts = [
'total' => 1,
'db' => 1,
];
$brokenLinks = [];
The email therefore reports one broken internal link but does not contain a corresponding detail row.
Expected result
The configured language restriction should be applied consistently to:
- records selected for link checking,
- old and new broken-link counts,
- the detailed broken-link list,
- the decision whether a notification email should be sent.
With only language 1 configured, a broken link in a record with sys_language_uid = 0 should not be checked or counted.
Technical analysis
In LinkAnalyzerResult::getResultForTask(), the configured languages are converted into an array:
$languageIds = GeneralUtility::intExplode(',', $languages, true);
However, the language IDs are not passed to LinkAnalyzer::init(), LinkAnalyzer::getLinkStatistics() or LinkAnalyzer::getLinkCounts():
$this->linkAnalyzer->init($searchFields, $pageIds, $modTSconfig);
$this->oldBrokenLinkCounts = $this->linkAnalyzer->getLinkCounts();
$this->linkAnalyzer->getLinkStatistics($linkTypes, $checkHidden);
$this->newBrokenLinkCounts = $this->linkAnalyzer->getLinkCounts();
The configured language IDs are only passed to the subsequent detail query:
$this->brokenLinks = $this->brokenLinkRepository->getAllBrokenLinksForPages(
$pageIds,
$linkTypes,
$searchFields,
$languageIds
);
LinkAnalyzer::getLinkStatistics() selects records by page UID or PID but does not add a constraint for the table’s TCA language field. It therefore also checks records from
languages that are not configured in the Scheduler task.
BrokenLinkRepository::getNumberOfBrokenLinksForRecordsOnPages() also counts by page IDs without accepting or applying a language restriction.
getAllBrokenLinksForPages(), on the other hand, adds this restriction:
if ($languages !== []) {
$constraints[] = $queryBuilder->expr()->in(
'language',
$queryBuilder->quoteArrayBasedValueListToIntegerList($languages)
);
}
This difference causes the summary counts and detailed result list to use different language scopes.
Affected versions
Runtime reproduction:
- TYPO3 12.4.46 ELTS
- PHP 8.3
Source inspection shows the same relevant control flow in:
- TYPO3 13.4
- TYPO3 14.3
- Current
mainbranch
Reviews 2
History 38
-
Benni Mack changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2026-08-06T16:03:01+00:00" > 08/06/26, 16:03 </span>
-
Juliane Wundermann changed assigned to Juliane Wundermann <span data-processor="relativetime" data-value="2026-08-06T20:03:20+00:00" > 08/06/26, 20:03 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95140 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-06T20:08:55+00:00" > 08/06/26, 20:08 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95140 <span data-processor="relativetime" data-value="2026-08-06T20:10:11+00:00" > 08/06/26, 20:10 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95140 <span data-processor="relativetime" data-value="2026-08-06T20:38:45+00:00" > 08/06/26, 20:38 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 95140 <span data-processor="relativetime" data-value="2026-08-07T08:46:00+00:00" > 08/07/26, 08:46 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95265 <span data-processor="relativetime" data-value="2026-08-11T15:28:51+00:00" > 08/11/26, 15:28 </span>
-
Juliane Wundermann commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-08-11T15:30:09+00:00" > 08/11/26, 15:30 </span>
Applied in changeset commit:b4b607ad2e3880fb0bbab2867fe73e3d24af9302.