$form_state storage disappears after form submit + submit on F5

Created on 4 February 2024, 5 months ago
Updated 7 February 2024, 4 months ago

Problem/Motivation

$form_state storage disappears after form submit+F5

Steps to reproduce

1. Create simple form:

  public function buildForm(array $form, FormStateInterface $form_state): array {
    $form['submit'] = [
      '#type' => 'submit',
      '#value' => 'Click me (' . (int)$form_state->get('counter') . ')',
    ];

    return $form;
  }

  public function submitForm(array &$form, FormStateInterface $form_state): void {
    $form_state->set('counter', (int)$form_state->get('counter') + 1);
    $form_state->setRebuild();
  }

2. Click several times on button.

3. Press F5 in browser.

🐛 Bug report
Status

Active

Version

10.2

Component
Form 

Last updated 1 minute ago

Created by

🇷🇺Russia xandeadx

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024