Issue Bug Closed

#99764Repository Injection in Middleware is causing Typo3 v11 to don't find default controller for plugins anymore

Sabrina Zwirner 01/31/23, 10:08 updated 07/10/24, 07:58

Description

Hello,
i was updating my project from v10 to v11 php8.1 and got the following error for every Plugin that i included:

> The default controller for extension “XY” and plugin “XYZ” can not be determined. Please check for TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() in your ext_localconf.php.

After testing i found out that the problem was my middleware. It got registeres after ‘typo3/cms-frontend/authentication’ and before ‘typo3/cms-frontend/page-resolver’ to create a deeplogin (read out get parameter before the user gets redirected to the login page).

The Problem was that i registered an AccountRepository in the constructor.

/** @var AccountRepository */
protected $accountRepository;

public function __construct(?Context $context = null, ?AccountRepository $accountRepository = null)
{
 $this->context = $context ?? GeneralUtility::makeInstance(Context::class);
 $this->accountRepository = $accountRepository;
}

I also tried to register it with:

$account = GeneralUtility::makeInstance(AccountRepository::class);

but this created the same error.

I realy dont understand why this is now happening in v11 and it looks for me like a bug. It seamed that only when you register the middleware after the ‘typo3/cms-frontend/page-resolver’ you could fix this issue, but then you cant redirect the user intime before other redirects are happening.

Would be great when this is getting fixed or we find a propper solution for it.

Reviews 0

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