-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fixes #6585 #6614
fixes #6585 #6614
Conversation
… when using nested collections
It fixes the issue, but isn't it better to create a method that does one thing and only populates? The values can be provided as an argument to that method like this: $data = $this->extract();
$this->populate($data); That looks a bit cleaner to me instead of one call to |
Agree that would make more elegant solution. Made the changes |
* @param bool $onlyBase | ||
* @return void | ||
*/ | ||
public function populateValues($data, $onlyBase = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be private
or protected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's overriding method from fieldset. So either we need to figure out a new name for this or keep it public :(
We could take that method away from the form all together but that would change the existing behavior a little (Namely that the form would populate every field instead of just the base during bind and validation without data)..Tests seem to pass then also, but I'd be surprised if there wouldn't be any side effects in some app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's an override then it's fine: I just don't want new API that is an implementation detail :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me neither :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's inherited, could you replace the docblock with {@inheritDoc}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -522,4 +523,25 @@ public function testShouldValidateAllowObjectBindingByObject() | |||
$this->assertTrue($allowed); | |||
} | |||
|
|||
public function testBindValuesPreservesNewValueAfterValidation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you can add a group annotation so it is clear why the test is needed? See #6711
Linking #6711 |
fixes #6585