Problem/Motivation
When a required field item is removed and added again, the required validation fails.
Steps to reproduce
Testing with a Text (formatted, long) required field.
Steps to reproduce:
1. Enter text in the field.
2. Click on Remove.
3. Add another item.
4. Enter text and save.
5. Validation for the required field fails.
Issue fork sam-3442879
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
Comment #3
minirobot commentedComment #4
minirobot commentedThere is a core issue related to multiple value field validation: https://www.drupal.org/project/drupal/issues/3344082. Only the first item is validated rather than the field as a whole.
I propose that we do not make the first set of fields removable until this is fixed. I've updated the merge request and tests.
Comment #5
marcoscanoThanks for working on this! I have not tested it myself, but I agree keeping it simple and adding the remove button only for widgets with more than one element makes sense.
RTBC to me, will wait a little bit in case @penyaskito has something additional to add since he reviewed the previous approach, but I'm 👍 to move forward with this.
Comment #6
penyaskito👍 I wasn't sure I understood the problem, but @minirobot was patient with me and we huddled about it. Let's get this in :-D
Comment #8
marcoscanoThank you both! 🙏
Committed and tagged https://www.drupal.org/project/sam/releases/1.2.1
Comment #9
minirobot commentedYay thank you!