Project

General

Profile

Actions

Bug #99764

closed

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

Added by Sabrina Zwirner over 1 year ago. Updated 7 days ago.

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

0%

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

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.

Actions

Also available in: Atom PDF