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] FormBuilder Bug Fix: remove() was not properly removing children #4826

Merged
merged 1 commit into from Jul 10, 2012
Merged

[Form] FormBuilder Bug Fix: remove() was not properly removing children #4826

merged 1 commit into from Jul 10, 2012

Conversation

christickner
Copy link

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4803
License of the code: MIT

FormBuilder initially sets unresolved children as NULL, until resolved.
If FormBuilder::remove() is called before that child is resolved, the
if statement turns false, because isset(null) is false, when it should
be true. Instead, we should check to see if the key exists, and if so,
process and unset it.

Closes #4803

@webmozart
Copy link
Contributor

Can you please add a test covering this case?

@christickner
Copy link
Author

Sure, added a test case. It fails before the patch and passes after.

@webmozart
Copy link
Contributor

Thanks. Can you please add a comment to the test with the URL of this PR? Also, please squash your commits into one when your done.

FormBuilder initially sets unresolved children as NULL, until resolved.
 If FormBuilder::remove() is called before that child is resolved, the
if statement turns false, because isset(null) is false, when it should
be true.  Instead, we should check to see if the key exists, and if so,
process and unset it.

Closes #4803
@christickner
Copy link
Author

Oops, I deleted the remote branch and re-pushed without realizing we'd lose some history on this PR page. Live and learn I suppose.

@webmozart
Copy link
Contributor

Thanks!

fabpot added a commit that referenced this pull request Jul 10, 2012
Commits
-------

f71e2a8 [Form] FormBuilder Bug Fix: remove() was not properly removing children

Discussion
----------

[Form] FormBuilder Bug Fix: remove() was not properly removing children

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4803
License of the code: MIT

FormBuilder initially sets unresolved children as NULL, until resolved.
 If FormBuilder::remove() is called before that child is resolved, the
if statement turns false, because isset(null) is false, when it should
be true.  Instead, we should check to see if the key exists, and if so,
process and unset it.

Closes #4803

---------------------------------------------------------------------------

by bschussek at 2012-07-10T07:41:55Z

Can you please add a test covering this case?

---------------------------------------------------------------------------

by ChrisTickner at 2012-07-10T09:43:07Z

Sure, added a test case.  It fails before the patch and passes after.

---------------------------------------------------------------------------

by bschussek at 2012-07-10T09:47:06Z

Thanks. Can you please add a comment to the test with the URL of this PR? Also, please squash your commits into one when your done.

---------------------------------------------------------------------------

by ChrisTickner at 2012-07-10T10:02:16Z

Oops, I deleted the remote branch and re-pushed without realizing we'd lose some history on this PR page.  Live and learn I suppose.

---------------------------------------------------------------------------

by bschussek at 2012-07-10T10:18:20Z

Thanks!
@fabpot fabpot merged commit f71e2a8 into symfony:master Jul 10, 2012
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.

[Form] Fatal error: Call to a member function getForm() on a non-object
3 participants