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
!5959
Issue
#3177977
: Cache form state in #process callbacks even after rebuild.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3177977
: Cache form state in #process callbacks even after rebuild.
issue/drupal-3177977:3177977-form-state-storage
into
11.x
Overview
5
Commits
12
Pipelines
21
Changes
2
Open
godotislate
requested to merge
issue/drupal-3177977:3177977-form-state-storage
into
11.x
1 year ago
Overview
5
Commits
12
Pipelines
21
Changes
2
Expand
Closes
#3177977
0
0
Merge request reports
Compare
11.x
version 20
159d3401
3 days ago
version 19
3aaea9d0
3 days ago
version 18
6fb6d260
3 days ago
version 17
97d03f94
5 days ago
version 16
ed6ba051
1 month ago
version 15
8e2051d1
1 month ago
version 14
fa27d4f4
1 month ago
version 13
8c52f8ba
1 month ago
version 12
6ab24b87
1 month ago
version 11
feccda25
3 months ago
version 10
370d3677
4 months ago
version 9
401cc816
7 months ago
version 8
9cb2c61a
1 year ago
version 7
ce318260
1 year ago
version 6
064d488c
1 year ago
version 5
9d7701e3
1 year ago
version 4
791923dc
1 year ago
version 3
6a4a0ac5
1 year ago
version 2
09aa8bd9
1 year ago
version 1
8b3821e9
1 year ago
11.x (HEAD)
and
latest version
latest version
990c50e3
12 commits,
3 days ago
version 20
159d3401
11 commits,
3 days ago
version 19
3aaea9d0
10 commits,
3 days ago
version 18
6fb6d260
9 commits,
3 days ago
version 17
97d03f94
8 commits,
5 days ago
version 16
ed6ba051
7 commits,
1 month ago
version 15
8e2051d1
6 commits,
1 month ago
version 14
fa27d4f4
5 commits,
1 month ago
version 13
8c52f8ba
4 commits,
1 month ago
version 12
6ab24b87
4 commits,
1 month ago
version 11
feccda25
3 commits,
3 months ago
version 10
370d3677
3 commits,
4 months ago
version 9
401cc816
3 commits,
7 months ago
version 8
9cb2c61a
2 commits,
1 year ago
version 7
ce318260
2 commits,
1 year ago
version 6
064d488c
2 commits,
1 year ago
version 5
9d7701e3
1 commit,
1 year ago
version 4
791923dc
1 commit,
1 year ago
version 3
6a4a0ac5
1 commit,
1 year ago
version 2
09aa8bd9
1 commit,
1 year ago
version 1
8b3821e9
1 commit,
1 year ago
2 files
+
199
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/Form/FormBuilder.php
+
17
−
9
Options
@@ -428,20 +428,28 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form
$this
->
prepareForm
(
$form_id
,
$form
,
$form_state
);
// Caching is normally done in self::processForm(), but what needs to be
// cached is the $form structure before it passes through
// self::doBuildForm(), so we need to do it here.
// @todo For Drupal 8, find a way to avoid this code duplication.
if
(
$form_state
->
isCached
())
{
$this
->
setCache
(
$form
[
'#build_id'
],
$form
,
$form_state
);
}
// Clear out all group associations as these might be different when
// re-rendering the form.
$form_state
->
setGroups
([]);
// Retain unprocessed form, because what needs to be cached is $form
// structure before it passes through self::doBuildForm().
$unprocessed_form
=
$form
;
$form
=
$this
->
doBuildForm
(
$form_id
,
$form
,
$form_state
);
// After processing the form, the form builder or a #process callback may
// have called $form_state->setCached() to indicate that the form and form
// state shall be cached. But the form may only be cached if
// $form_state->disableCache() is not called. Only cache $form as it was
// prior to self::doBuildForm(), because self::doBuildForm() must run for
// each request to accommodate new user input.
// @see self::processForm()
if
(
$form_state
->
isCached
())
{
$this
->
setCache
(
$form
[
'#build_id'
],
$unprocessed_form
,
$form_state
);
}
// Return a fully built form that is ready for rendering.
return
$
this
->
doBuildForm
(
$form_id
,
$form
,
$form_state
)
;
return
$
form
;
}
/**
Loading