Issue Bug Closed

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

Sybille Peters 06/19/23, 10:17 updated 07/18/23, 08:38

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)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.