Project

General

Profile

Actions

Bug #103423

closed

Invalid array offset error in linkvalidator

Added by Georg Großberger 8 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
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

Also available in: Atom PDF