Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!10787
Render regions in fibers
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Render regions in fibers
issue/drupal-3496835:3496835-render-children-in
into
11.x
Overview
0
Commits
7
Pipelines
7
Changes
1
Open
catch
requested to merge
issue/drupal-3496835:3496835-render-children-in
into
11.x
3 months ago
Overview
0
Commits
7
Pipelines
7
Changes
1
Expand
This reverts commit cf8d49adbb36640bf98278ed7613d7d1a2e29060.
Closes
#3496835
0
0
Merge request reports
Compare
11.x
version 6
8433b85e
3 months ago
version 5
cd2cb325
3 months ago
version 4
a6036ef0
3 months ago
version 3
e47da374
3 months ago
version 2
dc3f27f5
3 months ago
version 1
79a490a1
3 months ago
11.x (HEAD)
and
latest version
latest version
d41db014
7 commits,
3 months ago
version 6
8433b85e
9 commits,
3 months ago
version 5
cd2cb325
8 commits,
3 months ago
version 4
a6036ef0
6 commits,
3 months ago
version 3
e47da374
5 commits,
3 months ago
version 2
dc3f27f5
5 commits,
3 months ago
version 1
79a490a1
5 commits,
3 months ago
1 file
+
40
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/lib/Drupal/Core/Render/Renderer.php
+
40
−
1
Options
@@ -462,8 +462,47 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
// has an empty #children attribute, render the children now. This is the
// same process as Renderer::render() but is inlined for speed.
if
((
!
$theme_is_implemented
||
isset
(
$elements
[
'#render_children'
]))
&&
empty
(
$elements
[
'#children'
]))
{
$fibers
=
[];
// @todo use revolt.
foreach
(
$children
as
$key
)
{
$elements
[
'#children'
]
.
=
$this
->
doRender
(
$elements
[
$key
]);
$fibers
[
$key
]
=
new
\Fiber
(
fn
()
=>
$this
->
doRender
(
$elements
[
$key
]));
}
$rendered_children
=
[];
$iterations
=
0
;
while
(
count
(
$fibers
)
>
0
)
{
foreach
(
$fibers
as
$key
=>
$fiber
)
{
try
{
if
(
!
$fiber
->
isStarted
())
{
$fiber
->
start
();
}
elseif
(
$fiber
->
isSuspended
())
{
$fiber
->
resume
();
}
// If the Fiber hasn't terminated by this point, move onto the next
// placeholder, we'll resume this Fiber again when we get back here.
if
(
!
$fiber
->
isTerminated
())
{
// If we've gone through the placeholders once already, and they're
// still not finished, then start to allow code higher up the stack
// to get on with something else.
if
(
$iterations
)
{
$fiber
=
\Fiber
::
getCurrent
();
if
(
$fiber
!==
NULL
)
{
$fiber
->
suspend
();
}
}
continue
;
}
$rendered_children
[
$key
]
=
$fiber
->
getReturn
();
unset
(
$fibers
[
$key
]);
}
catch
(
\Throwable
$e
)
{
throw
$e
;
}
}
$iterations
++
;
}
foreach
(
$children
as
$key
)
{
$elements
[
'#children'
]
.
=
$rendered_children
[
$key
];
}
$elements
[
'#children'
]
=
Markup
::
create
(
$elements
[
'#children'
]);
}
Loading