derhansen / xclass_di

TYPO3 Test Extension to evaluate DI when xclassing an extbase controller
1 stars 1 forks source link

TYPO3 12 compatibility #3

Open cseifert opened 1 month ago

cseifert commented 1 month ago

The recent dev version doesn't work with TYPO3 12 at the moment. After installing the extension the signatures of the BackendLogController must be adapted to the current 12 API. Afterwards, the following error occurs when calling the protocol backend module:

The "TYPO3\CMS\Belog\Controller\BackendLogController" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

It seems, that the DI has changed once again since 11 LTS and the overriding of controllers with additional arguments of the constructor needs a new trick.

paulAtSlim commented 3 weeks ago

Sadly I noticed this too with v13. The only "solution" would be to set the defaults to public

services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: true

But this is AFAIK bad practice.

//Edit Just found out that you can only set the aliased service as public this way:

  TYPO3\CMS\FrontendLogin\Controller\LoginController:
    public: true
    alias: 'Vendor\Extension\Xclass\LoginController'