symfony-cmf / content-bundle

Provides some basic document classes and controllers for modeling content
https://cmf.symfony.com
19 stars 32 forks source link

Can not fetch generic controller any more #185

Closed ElectricMaxxx closed 6 years ago

ElectricMaxxx commented 6 years ago

Having SF4 fetching the generic controller (defined template_byl_class in routing configuration) ends in an exception:

LogicException:
Controller "cmf_content.controller" cannot be fetched from the container because it is private. Did you forget to tag the service with "controller.service_arguments"?

  at vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:116
  at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->throwExceptionIfControllerWasRemoved('cmf_content.controller')
     (vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:73)
  at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->createController('cmf_content.controller')
     (vendor/symfony/framework-bundle/Controller/ControllerResolver.php:43)
  at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->createController('cmf_content.controller:indexAction')
     (vendor/symfony/http-kernel/Controller/ControllerResolver.php:69)
  at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController(object(Request))
     (vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:41)
  at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->getController(object(Request))
     (vendor/symfony/http-kernel/HttpKernel.php:132)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:66)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:190)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:37)
dbu commented 6 years ago

can you try adding that tag?

ElectricMaxxx commented 6 years ago

I think we should either make it public. This one works for me. As long as we have Symfony < 3.3 we can not use that flag.

dbu commented 6 years ago

reading https://symfony.com/doc/current/controller.html#fetching-services it seems that a controller must be defined as public (looking at the config example) even though they do not mention that explicitly. so lets make the controller service public.