Problem/Motivation

As in the title. This leads to unexpected results, for example empty string values leaking to configuration.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3467091

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

graber created an issue. See original summary.

graber’s picture

Version: 11.0.x-dev » 11.x-dev

sorlov made their first commit to this issue’s fork.

sorlov’s picture

Status: Active » Needs work
sorlov’s picture

Unsure if we need such global form API changes (as it affects many things)

Maybe better work on it from Item render element

sorlov’s picture

This issue can be easily fixed when you use '#input' => FALSE, for your item element

sorlov’s picture

Status: Needs work » Needs review
graber’s picture

Status: Needs review » Needs work
prashant.c’s picture

Can someone please list down the "Steps to reproduce"? Thanks

andypost’s picture

The #input allowed with a big comment in #1825044: Turn contact form submissions into full-blown Contact Message entities, without storage

OLD code

  // Form structure.
  $types['item'] = array(
    // Forms that show author fields to both anonymous and authenticated users
    // need to dynamically switch between #type 'textfield' and #type 'item' to
    // automatically take over the authenticated user's information. Therefore,
    // we allow #type 'item' to receive input, which is internally assigned by
    // Form API based on the #default_value or #value properties.
    '#input' => TRUE,

andypost’s picture

Probably better to move the hack to contact module as no input expected from the item form element

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.