Skip to content

[Form] broken submit behavior with zero indexed collection items. #52318

Closed
@jan-pintr

Description

@jan-pintr

Symfony version(s) affected

6.3.6

Description

#52021 introduced an issue when form collection contains zero indexed item.

When submitting form with zero indexed collection item its values are reindexed.

There was an attempt to fix this in b769b77 but it was not enough for this case. As the original issue is closed. There is new one.

How to reproduce

See reproducer with test case and proposed change:
https://github.com/symfony/symfony/compare/6.4...jan-pintr:symfony-form-zero-indexed-collection-reporoducer:form-zero-indexed-col-reproducer?expand=1

Possible Solution

Reproducer contains proposed change to FormUtil::mergeParamsAndFiles() function.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions