JMSDiExtraBundle icon indicating copy to clipboard operation
JMSDiExtraBundle copied to clipboard

JMSDiExtra makes not callable actions in Controller

Open stuzzo opened this issue 11 years ago • 5 comments

Hi, I noticed an issue with JMSDiExtraBundle version 1.5.0. In my code I have a TestController that extends a BaseController (that not extends Symfony base controller). In BaseController I put all my common properties that are injected, such as container or logger. Now, I added an action testAction in TestController and the message I receive when I call it is:

request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "Controller "ACME\TestBundle\Controller\TestController::testAction" for URI "/test" is not callable."

I figured out that the problem is coming from the class JMS\DiExtraBundle\HttpKernel\ControllerResolver, line 83, because when it tries to call the action request, it calls the BaseController instead of TestController.

To resolve this issue in my code, I added a property in my TestController that contains a service injected, even if I not use it.

I think that is a problem with reflection.

stuzzo avatar Jan 13 '15 16:01 stuzzo

I have also ran into this exact bug

tystr avatar May 26 '15 20:05 tystr

I'm having this exact same bug.

LauraGonzalez avatar May 26 '15 20:05 LauraGonzalez

Same!

justintaft01 avatar Oct 27 '15 23:10 justintaft01

:-1:

kw1040 avatar Oct 27 '15 23:10 kw1040

Same for me. It's hard to believe, but this bug was reported 3 years, 5 months and 16 days ago: https://github.com/schmittjoh/JMSDiExtraBundle/issues/39, and it's still open.

arogulin avatar Jan 09 '16 01:01 arogulin