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 #1

Updated by Sybille Peters over 1 year ago

  • Description updated (diff)
Actions #2

Updated by Sybille Peters over 1 year ago

  • Description updated (diff)
Actions #3

Updated by Sybille Peters over 1 year ago

Hi @Česlav Przywara I am wondering if we should close this. I can't really reproduce it and figure out under what circumstances it could occur and during testing I might have loaded the page too early.

Can your reproduce any of this or find a scenario where it would occur?

I originally saw it in version v11 TYPO3.

Actions #4

Updated by Česlav Przywara over 1 year ago

Hi @Sybille Peters,

I got this error once when invoking typo3 binary. However, I made a mistake and had used ./typo_src/typo3/sysext/core/bin/typo3 instead of just ./typo3/sysext/core/bin/typo3. I guess I somehow broke autoloading and/or DI this way.

So as far as I'm concerned, the issue can be closed.

Actions #5

Updated by Sybille Peters over 1 year ago

  • Status changed from New to Closed

@Česlav Thanks for answering. I am closing. We can always reopen when we are more sure there is an actual issue with steps to reproduce.

Actions #6

Updated by Oliver Pfaff over 1 year ago

I got this error over cli, after a fresh composer install(TYPO3 12), with the command typo3 extension:setup. With verbose on extension:setup, i got the RuntimeException The requested database connection named "Default" has not been configured. My fault was that i didn't completed the installation before, after typo3 install:setup all was fine. Obviously with a brand new settings.php the system can setup db connection ;).

Maybe this info help out someone.

Actions

Also available in: Atom PDF