Project

General

Profile

Actions

Bug #101618

open

TypolinkSoftReferenceParser throws warnings and "referenceindex:update" crashes if the LinkService encounters stale t3:// URLs

Added by Christian Spoo over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2023-08-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

We noticed that updating the referenceindex via CLI aborts with an error when TYPO3 stumbles upon old t3:// links. Analysis showed that the t3:// link in question came from EXT:commerce which has been removed from the installation some time ago.

TYPO3 then tries to resolve this link using the LinkService (in typo3/sysext/core/Classes/DataHandling/SoftReference/TypolinkSoftReferenceParser.php:109) before mapping the result into a referenceindex item (in typo3/sysext/core/Classes/DataHandling/SoftReference/TypolinkSoftReferenceParser.php:173). Since the type array is missing, PHP >= 8 throws a warning. Although admittedly the link as such cannot be resolved at all (since nothing would handle it), this should not break the refindex update and influence the remaining sites.

If I rewrite TYPO3\CMS\Core\DataHandling\SoftReference\TypolinkSoftReferenceParser::setTypoLinkPartsElement and change line 173 into:

switch ((string)($tLP['type'] ?? '')) {

the refindex:update continues fine. What do you think regarding the expected behaviour of TypolinkSoftReferenceParser and TYPO3\CMS\Core\Database\ReferenceIndex? Should they fail more quickly or rather be error-tolerant in such cases?


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #100510: Undefined array key warning in TypolinkSoftReferenceParserClosedOliver Bartsch2023-04-06

Actions
Related to TYPO3 Core - Bug #95941: Prevent crashes in reference index update due to invalid user inputRejected2021-11-10

Actions
Actions

Also available in: Atom PDF