8000 [HttpKernel] added a comment to warn about possible inconsistencies · enumag/symfony@7117328 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7117328

Browse files
committed
[HttpKernel] added a comment to warn about possible inconsistencies
1 parent c4636e1 commit 7117328

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ public function setFragmentPath($path)
4646
*/
4747
protected function generateFragmentUri(ControllerReference $reference, Request $request)
4848
{
49+
// We need to forward the current _format and _locale values as we don't have
50+
// a proper routing pattern to do the job for us.
51+
// This makes things inconsistent if you switch from rendering a controller
52+
// to rendering a route if the route pattern does not contain the special
53+
// _format and _locale placeholders.
4954
if (!isset($reference->attributes['_format'])) {
5055
$reference->attributes['_format'] = $request->getRequestFormat();
5156
}
52-
5357
if (!isset($reference->attributes['_locale'])) {
5458
$reference->attributes['_locale'] = $request->getLocale();
5559
}

0 commit comments

Comments
 (0)
0