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.

CommentFileSizeAuthor
#2 patch-ajax-bug-3171656.diff885 bytese5sego
Command icon 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

e5sego created an issue. See original summary.

e5sego’s picture

StatusFileSize
new885 bytes
e5sego’s picture

Issue summary: View changes
e5sego’s picture

Title: Don't triffer form validation on ajax call » Should not trigger form validation on ajax call
e5sego’s picture

Issue summary: View changes
e5sego’s picture

Issue summary: View changes

AstonVictor made their first commit to this issue’s fork.

astonvictor’s picture

Status: Active » Fixed

Created and merged a new MR.

Updated the validation callback for all forms.

e5sego’s picture

Thank you for solving this old issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.