Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix numbering form type name of collection #5920

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

namex42
Copy link

@namex42 namex42 commented Sep 10, 2023

This fixes #5886.

Due array and ArrayCollection index starts from zero.

.replace(nameRegexp, numItems);

collection.dataset.numItems = numItems;
collection.dataset.numItems = ++numItems;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only partial fix. It works when you have all items in a row (like 0,1,2 etc)
изображение

But try to add 3 items and remove one in the middle to have 2 items with 0 and 2 keys:
изображение
validation errors will be broken after submit.
изображение
изображение
изображение
Issue is more complex.

@Seb33300
Copy link
Contributor

Duplicate of #6200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation message at bad path. Incorrect indexing of collection items when using custom form.
3 participants