Problem/Motivation
If you are on a node that has a paragraphs option, when you click the button to add a pargraph instance, it triggers the validation to run and shows warnings just above the paragraph.
We will need to detect that the event is somehow an initial add, and prevent validation from running.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork alt_text_validation-3541613
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 #2
swirtI have not determined a way to intercept this yet.
Comment #3
swirtI discovered this is not specific to Paragaphs. Even adding an image to an image field triggers validation on the whole node.
Comment #4
swirtThis was caused by ajax requests triggering the validation of the entire entity. I have hopped around this by detecting the ajax type of call and bypassing the validation in that case.
Other solutions would solve this by setting '#limit_validation_errors' on the form, but in the case of field constraints and validation, we don't have access to the form or form_state.
Comment #5
swirtComment #7
swirtThe MR solves the issue of premature firing of validation on ajax changes to the entity form.
Comment #9
swirtComment #10
swirtReleased with 1.0.0-beta3
Comment #12
swirtCrediting dafeder for kicking this around with me enough to lead me to a solution.