diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index 6aeeffd..8bd3129 100644 --- a/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -314,6 +314,9 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form */ public function getCache($form_build_id, FormStateInterface &$form_state) { if ($form = $this->keyValueExpirableFactory->get('form')->get($form_build_id)) { + if (\Drupal::getContainer()->initialized('session_manager')) { + \Drupal::getContainer()->get('session_manager')->startLazy(); + } $user = $this->currentUser(); if ((isset($form['#cache_token']) && $this->csrfToken->validate($form['#cache_token'])) || (!isset($form['#cache_token']) && $user->isAnonymous())) { if ($stored_form_state = $this->keyValueExpirableFactory->get('form_state')->get($form_build_id)) {