// Initialize the form's user input. The user input should include only the
// input meant to be treated as part of what is submitted to the form, so
// we base it on the form's method rather than the request's method. For
// example, when someone does a GET request for
// /node/add/article?destination=foo, which is a form that expects its
// submission method to be POST, the user input during the GET request
// should be initialized to empty rather than to ['destination' => 'foo'].
$input =
$form_state->
getUserInput();
if (!
isset($input)) { $input =
$form_state->
isMethodType('get'
) ?
$request->query->
all() :
$request->request->
all();
$form_state->
setUserInput($input);
} if (isset($_SESSION['batch_form_state'
])) { // We've been redirected here after a batch processing. The form has
// already been processed, but needs to be rebuilt. See _batch_finished().
$form_state =
$_SESSION['batch_form_state'
];
unset($_SESSION['batch_form_state'
]);
return $this->
rebuildForm($form_id,
$form_state);
} // If the incoming input contains a form_build_id, we'll check the cache for