Actions
Bug #103423
closedInvalid array offset error in linkvalidator
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
Target version:
Start date:
2024-03-19
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
Description
In \TYPO3\CMS\Linkvalidator\Result\LinkAnalyzerResult::getLocalizedPageId the linkanalyzer tries to find the UID of a page translation, with a fallback to "0" if none is found. The fallback is implemented with
// ...
->executeQuery()
->fetchAssociative()['uid'] ?: 0;
However, the method "fetchAssociative" return a boolean "false" if no record is available in the result and the "['uid']" access causes a "Trying to access array offset on false error" warning.
A possible fix is to change part of the getLocalizedPageId method to
// ...
->executeQuery()
->fetchAllAssociative()[0]['uid'] ?? 0;
Actions