adobe / adobe/aem-core-wcm-components
Form Prefill restores default values for emtpy fields on form submit failure
- Dominant language
- Java
- Stars
- 795
- Forks
- 775
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 8
Description
Bug present as of version: 2.24.7-SNAPSHOT
When a form submission fails, the Form Options field generally restores the options to what was submitted by the user. So if I have checkboxes submitted as:
[x] One [x] Two [ ] Three
On submit fail the values are restored to:
[x] One [x] Two [ ] Three
If one of the options is set to `Selected` as default by the field dialog the above still works **unless** the user submitted the form with all fields unchecked. So let's say "Three" is "Selected" by default.
User unchecks "Three" and submits
[ ] One [ ] Two [ ] Three
On failed submission, the form option is incorrectly reset to
[ ] One [ ] Two [x] Three
This issue also affects the Text field. This issue (default value restored for an empty submitted value) is not the same as https://github.com/adobe/aem-core-wcm-components/issues/2805 where Text field is giving priority to the default value over a non-empty submitted value.
Contributor guide
Research direction
Reproduce the failed-submit behavior with Form Options checkboxes whose default is Selected, then repeat it with an empty Text field. Compare the behavior with issue #2805 and trace the form prefill handling for these fields; done means submitted empty values remain empty after a failed submission instead of restoring defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100