Bug #101618
openTypolinkSoftReferenceParser throws warnings and "referenceindex:update" crashes if the LinkService encounters stale t3:// URLs
0%
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?