Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #1

Open
lukasniestroj opened this issue Jun 4, 2021 · 6 comments
Open

solution #1

lukasniestroj opened this issue Jun 4, 2021 · 6 comments

Comments

@lukasniestroj
Copy link

Hi @derhansen ,

I stumbled upon the same issue today.
After some research I came to the solution to add a reference to the Services.yaml.

TYPO3\CMS\Belog\Controller\BackendLogController: '@Derhansen\XclassDi\Controller\ExtendedBackendLogController'

In my case I had an overwritten Controller from ext:news.

@derhansen
Copy link
Owner

Cool, thanks a lot for providing the solution to the problem. I will add an example to the TYPO3 docs so this is documented.

@derhansen
Copy link
Owner

@stoppeye
Copy link

I was happy to find this hint and tried it in v12 with my own xlcassed version of \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController. I'm pretty sure I did it exactly as shown in your sample extension (checked + double-checked).
But it seems to behave differently. As soon as I add the reference in Services.yaml, I get something like:

Too few arguments to function MyVendor\MyExt\Scheduler\MyExtController::__construct(), 0 passed in /typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 2969 and exactly 9 expected

Without the extra line in Services.yaml I get the error with something like 8 passed in /typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3000 and exactly 9 expected, which is at least what you would expect. So the reference in Services.yaml did have an effect, just not the one I had hoped for...

Am I doing something wrong or has something changed in V12? Does the new tagging of the controller with #[BackendController] play into this? Or am I just too stupid to replicate your example?

@mschwemer
Copy link

mschwemer commented Mar 25, 2024

I have the same issue like @stoppeye and did not find a solution.

Any hints would be appreciated.

I am currently working on a v12 compatible upgrade of EXT:be_acl and need to modify the PermissionController,

@lukasniestroj
Copy link
Author

@mschwemer @stoppeye If you have autowire and autoconfigure enabled for your classes try to disable them for the XClass namespaces, also they should be private. I did not tested this with all variants but it helped if the base class had private services in DI

@stoppeye
Copy link

@lukasniestroj: thanks for your hint! Unfortunately I can't really test the use case I had, when I made my comment. I have found a completely different solution for my problem that doesn't require XClass anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants