Color me confused. I'm getting this error intermittently.
[2015-02-16 10:29:51] request.INFO: Matched route "app_site_default_edittargetsubmit" (parameters: "_controller": "App\SiteBundle\Controller\DefaultController::editTargetSubmitAction", "id": "17", "_route": "app_site_default_edittargetsubmit") [] []
[2015-02-16 10:29:51] security.DEBUG: Read SecurityContext from the session [] []
[2015-02-16 10:29:51] security.DEBUG: Reloading user from user provider. [] []
[2015-02-16 10:29:51] security.DEBUG: Username "[email protected]" was reloaded from user provider. [] []
[2015-02-16 10:29:51] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Routing\Exception\MissingMandatoryParametersException: "Some mandatory parameters are missing ("id") to generate a URL for route "adminCustomerTargets"." at /var/www/mysite/site/app/cache/prod/classes.php line 1264 {"exception":"[object] (Symfony\\Component\\Routing\\Exception\\MissingMandatoryParametersException: Some mandatory parameters are missing (\"id\") to generate a URL for route \"adminCustomerTargets\". at /var/www/ourbrightlink/site/app/cache/prod/classes.php:1264)"} []
[2015-02-16 10:29:51] security.DEBUG: Write SecurityContext in the session [] []
As you can see in the list of parameters in the first line of the exception, the id parameter is there. (parameters: "_controller": "App\SiteBundle\Controller\DefaultController::editTargetSubmitAction", "id": "17", "_route": "app_site_default_edittargetsubmit").
The route is defined via annotation:
/**
* Handles the submission of the Edit form.
*
* @route( "target/edit/{id}" )
* @method( {"POST"} )
* @template( "AppSiteBundle:Default:editTarget.html.twig" )
* @param Request $request
* @param $id
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function editTargetSubmitAction( Request $request, $id )
{ ... }
This is Symfony 2.5.6.
Suggestions? TIA
@Routeannotation is missing the route name, which in this case isapp_site_default_edittargetsubmit. Have you defined this route name elsewhere?