Item elements are added to form state

Created on 11 August 2020, almost 4 years ago
Updated 13 March 2023, over 1 year ago

Problem/Motivation

Drupal\Core\Render\Element\Item has following documentation:

Provides a display-only form element with an optional title and description.

However, when item is rendered inside a form, it gets added to form state. This has potential side effects for example with config forms that are trying to save all values from form state. See #3082672-65: Form prefix/suffix redesign in Claro for an example of that.

Proposed resolution

Preferable approach would be to not add item elements to the form state. If this is not possible, we should at least update the documentation to make it clear that the item elements are not display only since they get added to the form state.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

10.1

Component
Form 

Last updated about 11 hours ago

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

    As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" almost a year ago with a request for more information and there has been no activity since that time.

    Since we need more information to move forward with this issue, I am tagging for Bug Smash Initiative and keeping the status at Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • Status changed to Needs review over 1 year ago
  • 🇫🇮Finland lauriii Finland

    This bug still exists. Here's the test-only patch from #2.

  • 🇮🇳India Aadhar_Gupta

    Patch for d10 fixing test cases in comment #17

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    If this was a reroll from #10 looks like some changes are now missing.

    Please include an interdiff with patches and a comment for how it no longer applies.

Production build 0.69.0 2024