#94469Dependency Injection fails in UserFunc breaking copy in the BE
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
Bildschirmfoto%202021-07-02%20um%2011.42.13.png
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 3
-
Henrik Elsner commented 07/02/21, 11:42
-
Oliver Bartsch commented and changed status
NewNeeds Feedback 07/13/21, 20:14Hi, 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?
-
Riccardo De Contardi commented and changed status
Needs FeedbackClosed 12/30/21, 09:43No feedback since a long time => closing the issue.
If you think that this is the wrong decision or there is still work that should be done here, please reopen it or open a new issue with a reference to this one.
Thank you.
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.