E57D Forward `_stateless` attribute to inline rendered fragments · symfony/symfony@38db617 · GitHub
[go: up one dir, main page]

Skip to content

Commit 38db617

Browse files
committed
Forward _stateless attribute to inline rendered fragments
1 parent ff98eff commit 38db617

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Symfony/Component/HttpKernel/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CHANGELOG
1515
* Add `#[MapQueryString]` to map and validate request query string from `Request::$query->all()` to typed objects
1616
* Add `#[MapQueryParameter]` to map and validate individual query parameters to controller arguments
1717
* Collect data from every event dispatcher
18+
* Forward `_stateless` attribute to inline rendered fragments
1819

1920
6.2
2021
---

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ public function render(string|ControllerReference $uri, Request $request, array
5454
$attributes = $reference->attributes;
5555
$reference->attributes = [];
5656

57-
// The request format and locale might have been overridden by the user
58-
foreach (['_format', '_locale'] as $key) {
57+
// These attributes might have been overridden by the user
58+
foreach (['_format', '_locale', '_stateless'] as $key) {
5959
if (isset($attributes[$key])) {
6060
$reference->attributes[$key] = $attributes[$key];
6161
}
6262
}
6363

64+
if (!isset($attributes['_stateless']) && $request->attributes->has('_stateless')) {
65+
$reference->attributes['_stateless'] = $request->attributes->getBoolean('_stateless');
66+
}
67+
6468
$uri = $this->generateFragmentUri($uri, $request, false, false);
6569

6670
$reference->attributes = array_merge($attributes, $reference->attributes);

0 commit comments

Comments
 (0)
0