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

[Form] Fix form value merging involving file upload, collection & checkbox #54324

Open
wants to merge 13 commits into
base: 5.4
Choose a base branch
from

Conversation

priyadi
Copy link
Contributor

@priyadi priyadi commented Mar 18, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #53359
License MIT

This is an update to the PR #53353

This fixes another value-files merging bug involving collections of a form containing a file upload field and a checkbox.

@priyadi
Copy link
Contributor Author

priyadi commented Mar 18, 2024

paging @nicolas-grekas

@@ -30,8 +30,6 @@ private function __construct()
* a form and needs to be consistent. PHP keyword `empty` cannot
* be used as it also considers 0 and "0" to be empty.
*
* @param mixed $data
Copy link
Member

Choose a reason for hiding this comment

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

let's keep this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fabbot insists that I remove it. I reverted the changes, but it won't pass the test.

src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
src/Symfony/Component/Form/Util/ParamFilesMerger.php Outdated Show resolved Hide resolved
@priyadi
Copy link
Contributor Author

priyadi commented May 12, 2024

@nicolas-grekas bump. Is there anything else I need to do before this PR can be merged?

*
* @internal
*/
class ParamFilesMerger
Copy link
Member

Choose a reason for hiding this comment

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

Instead of introducing this new internal class the code should be moved into private methods in FormUtil as the class is only used there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The class represents a node in the tree. It is used by itself to traverse the entire tree. The task will be very complicated without a dedicated class.

https://github.com/symfony/symfony/pull/54324/files/30c95b8c9396624a98f6e44b0f83889b77112ab7#diff-5983ae1bcb319a7efa00aa62df7a2bcfaeaabd1894959ed7994d30a79f2281deR120

Copy link
Member

Choose a reason for hiding this comment

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

I have sent a PR against your fork which inlines the methods from the ParamFilesMerger class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have merged your PR

@priyadi priyadi force-pushed the dev-fix-merge-options-form branch from 4a6078e to 1cf2c5f Compare May 17, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants