Project

General

Profile

Actions

Bug #101119

closed

SoftReferenceParserFactory has 2 required constructor arguments but might get instantiated without arguments via ReferenceIndex

Added by Sybille Peters over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-06-19
Due date:
% Done:

0%

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

Description

Update : It should be possible to get an instance of an object with GeneralUtility::makeInstance which is instantiated with DI without the constructor arguments (at least from looking at makeInstance).

I am still investigating how to reproduce this, what is exactly the problem and if it is a core bug ....


core SoftReferenceParserFactory.php constructor has 2 arguments, but is instantiated without arguments in ReferenceIndex.php if object not passed in constructor.

This occurred after installation of causal/extractor and only in combination with specific other extensions. I have not been able to narrow it down. The exception appears when opening "Extension Configuration".

Anyhow, the code in the core looks wrong:

in /typo3/sysext/core/Classes/Database/ReferenceIndex.php line 126

$this->softReferenceParserFactory = $softReferenceParserFactory ?? GeneralUtility::makeInstance(SoftReferenceParserFactory::class);

typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceParserFactory.php line 33

public function __construct(FrontendInterface $runtimeCache, LoggerInterface $logger)

instantiated in FileIndexRepository line 339

 public function updateRefIndex($id)
    {
        $refIndexObj = GeneralUtility::makeInstance(ReferenceIndex::class);

Versions

  • reproduced with 11.5.28, not checked with v12 / main

Exception stack trace

see file exception_extconf.txt (linked below)


Files

exception_extconf.txt (390 KB) exception_extconf.txt Sybille Peters, 2023-06-19 10:16
Actions

Also available in: Atom PDF