TfaSetupForm overrides form_state storage

Created on 3 June 2022, about 3 years ago
Updated 28 May 2025, 11 days ago

Problem/Motivation

Currently in BasicSetup buildForm() the setup code will obtain the storage early on, make modifications, and force the storage to be saved with setStorage() which overwrites any data that may have been input. This prevents passing data through the form API. Many modules appear to use the tempstore.private service as an alternative, though on an initial glance I would expect this could lead to data inconsistency if a user were to load the form in multiple browser tabs before choosing to submit a form.

Additionally submitForm() and tfaNextSetupStep() also have calls to setStorage() though these may be less obstructing.

Steps to reproduce

Review BasicSetup.php

Proposed resolution

Convert to setting the values while merging in any changes made inside plugin forms.

Remaining tasks

Write patch.

User interface changes

None

API changes

Form state will be adjustable from inside plugins.

Data model changes

None

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cmlara

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024