Fields hidden after form error

Created on 21 February 2025, about 2 months ago

Problem/Motivation

When form validation fails after form submission (not when ajax catches the error) new values may be hidden.

Steps to reproduce

  • Starting with a default install of drupal and this module installed
  • Create 4 terms in the Tags vocabulary
  • Modify the article content type to make the body field mandatory and the tag field to be limited to 4 values
  • Create a new article
  • Fill in mandatory fields, add 3 values to the tag field, DO NOT fill in the body field
  • Submit the form
  • See the error about the missing body field
  • See that the tag field is not displaying the second and third value that was filled in

Proposed resolution

Some extra checks during the form alter is required in order to detect user input that is not yet part of the form state or the field item.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada geekygnr Waterloo

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024