Issue Bug Resolved

#110210LinkValidator Scheduler ignores configured languages when checking and counting broken links

Theodor Weinreich 07/16/26, 13:01 updated 08/11/26, 15:30

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

  1. Set up a TYPO3 installation with EXT:linkvalidator and EXT:scheduler.
  2. Configure at least two site languages:
    1. Default language with language ID 0
    2. A second language with language ID 1
  3. Create a visible page in the default language.
  4. Create a content element on that page in language 0.
  5. Add an internal link from that content element to another page.
  6. Delete the linked target page so that the link becomes broken.
  7. Create a LinkValidator Scheduler task with:
    1. The created page as start page
    2. Depth 0
    3. Languages to search for broken links: 1
    4. A valid email recipient
  8. 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 main branch

Reviews 2

History 38

  1. Juliane Wundermann commented and changed status Under Review Resolved done 0 % 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.