Problem/Motivation
We use paragraphs on a contenttype. Usually, the paragraph subform will be added to the node add/edit by ajax trigger (>Add paragraph< button), as it is similar for multi-value fields (>Add another item< button).
Having unique_field validation configured for this content type, the paragraph-subform does not appear after ajax trigger.
Steps to reproduce
1. Add a paragraph or other multi-value field to an content type.
2. Add a validation rule to other field on same content type.
2. Add new value to the first field (expand the form). The form will not expand.
Proposed resolution
Do not validate the form if it was submitted by ajax.
Remaining tasks
I added a patch. Please test and improve. Not sure if the validation will be necessary in other cases even if form is submitted by ajax.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | patch-ajax-bug-3171656.diff | 885 bytes | e5sego |
Issue fork unique_field-3171656
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
e5sego commentedComment #3
e5sego commentedComment #4
e5sego commentedComment #5
e5sego commentedComment #6
e5sego commentedComment #9
astonvictor commentedCreated and merged a new MR.
Updated the validation callback for all forms.
Comment #10
e5sego commentedThank you for solving this old issue.