Bug #94469

Dependency Injection fails in UserFunc breaking copy in the BE

Added by Henrik Elsner 3 months ago. Updated 2 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2021-07-02
Due date:
% Done:

0%

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

Description

We got a DoktypeFilter in the BE which is used for TCA type group to filter the selection of pages.

The class has a construct with another class with methods to handle the filter.
The dependency injection fails as it seems when copying e.g. content in the BE.
This means the UserFunc filter affects the copy process, while it does fully work at its task to filter.

The Exception (attached) is only thrown via ListModule.
In the PageModule the copy fails silent // the exception is thrown in the XHR but not displayed


Files

#1

Updated by Henrik Elsner 3 months ago

UPDATE:
Either i got a config issue on my side or the same behavior can be watched when using the button bar hook to add buttons:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook']

I added a class via this registration which calls the same stack resulting in the same error.

#2

Updated by Oliver Bartsch 2 months ago

  • Status changed from New to Needs Feedback

Hi, this basically means autowiring does not work as those are instantiated with GeneralUtility::makeInstance(). Therefore, you have to declare those services public in your Services(.yaml|.php) configuration.

See https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/DependencyInjection/Index.html#knowing-what-to-make-public for more information.

Could you please check if this solves the issue for you?

Also available in: Atom PDF