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
Commits
ceb626e6
Commit
ceb626e6
authored
2 months ago
by
Brandon Lira
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2776661
: Clarify docs for setRebuild() and isRebuilding() usage in processForm()
parent
66206ec4
No related branches found
No related tags found
1 merge request
!9319
FormBuild docs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Core/Form/FormBuilder.php
+10
-9
10 additions, 9 deletions
core/lib/Drupal/Core/Form/FormBuilder.php
with
10 additions
and
9 deletions
core/lib/Drupal/Core/Form/FormBuilder.php
+
10
−
9
View file @
ceb626e6
...
...
@@ -602,16 +602,17 @@ public function processForm($form_id, &$form, FormStateInterface &$form_state) {
return
;
}
// If $form_state->
i
sRebuild
ing() returns TRUE
and input has been
processed
// without validation errors, we are in a multi-step workflow
that is not yet
//
complete. In this scenario, a
new $form
must
be constructed based
on the
// changes made to $form_state during this request.
// If $form_state->s
et
Rebuild
(TRUE) was called
and input has been
//
processed
without validation errors, we are in a multi-step workflow
//
that is not yet complete. A
new $form
needs to
be constructed based
//
on the
changes made to $form_state during this request.
//
// Typically, a submit handler calls $form_state->setRebuild(TRUE) when a fully
// executed form requires another step. However, for forms that have not been
// fully executed (e.g., Ajax submissions triggered by non-buttons), there is
// no submit handler to invoke setRebuild(). In that case, we also rebuild
// error-free, non-executed forms, regardless of $form_state->isRebuilding().
// Typically, a submit handler calls $form_state->setRebuild(TRUE) when
// a fully executed form requires another step. However, for forms that
// have not been fully executed (e.g., AJAX submissions triggered by
// non-buttons), there is no submit handler to call setRebuild(). In
// that case, we also rebuild error-free, non-executed forms, regardless
// of $form_state->isRebuilding().
// @todo Simplify this logic; considering Ajax and non-HTML front-ends,
// along with element-level #submit properties, it makes no sense to
// have divergent form execution based on whether the triggering element
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment