Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] [DX] Collection of form with delete empty is not clear #7630

Closed
Labels
DXFormhasPRA Pull Request has already been submitted for this issue.
Milestone
@murilolobato

Description

@murilolobato

Instructions about delete_empty are partially ok. It instructs only that allow_delete must be enabled.

If you have a collection of another form type, and you want that empty items are deleted, you have to dig around the web (old issues and wrong workarounds), to discover that you just have to setentry_options => array('required' => false) at the collection definition.

I've discovered this searching in the issues. And foundsymfony/symfony#13940 which points tohttps://github.com/symfony/Form/blob/master/Tests/Extension/Core/Type/CollectionTypeTest.php#L145-166

I think, we could update the collection doc, in the section of delete_empty, to warn the developers about this behavior. And, why thisentry_options => array('required' => false) makes sense? In my opinion, i think it is not legible. I'm available to help!

UPDATE
I have just found, whyrequired => false makes sense.http://symfony.com/doc/2.8/reference/forms/types/form.html#empty-data

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXFormhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp