From 7117328bd7ab4bcb0a3c5575a4c8d3310565a4d3 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 22 Aug 2013 09:01:15 +0200 Subject: [PATCH] [HttpKernel] added a comment to warn about possible inconsistencies --- .../HttpKernel/Fragment/RoutableFragmentRenderer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php index 48b90f8054..1f3b84f619 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php @@ -46,10 +46,14 @@ abstract class RoutableFragmentRenderer implements FragmentRendererInterface */ protected function generateFragmentUri(ControllerReference $reference, Request $request) { + // We need to forward the current _format and _locale values as we don't have + // a proper routing pattern to do the job for us. + // This makes things inconsistent if you switch from rendering a controller + // to rendering a route if the route pattern does not contain the special + // _format and _locale placeholders. if (!isset($reference->attributes['_format'])) { $reference->attributes['_format'] = $request->getRequestFormat(); } - if (!isset($reference->attributes['_locale'])) { $reference->attributes['_locale'] = $request->getLocale(); }