Project

General

Profile

Actions

Bug #103423

closed

Invalid array offset error in linkvalidator

Added by Georg Großberger about 1 month ago. Updated 27 days ago.

Status:
Resolved
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 #1

Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83582

Actions #2

Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83582

Actions #3

Updated by Gerrit Code Review about 1 month ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83582

Actions #4

Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83582

Actions #5

Updated by Gerrit Code Review about 1 month ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83582

Actions #6

Updated by Gerrit Code Review 27 days ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83660

Actions #7

Updated by Gerrit Code Review 27 days ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83661

Actions #8

Updated by Sybille Peters 27 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF