Closed
Description
Description
As dicussed in #36492 the Symfony\Component\Form\Extension\Core\PropertyPathMapper
does not behave as expected.
When trying to write form values to an object it fails if the property is not readable.
The current implementation tries to get the value to avoid setting an identical value.
PropertyPathMapper
should catch any exceptions that are specific to reading the property when trying to write it.
It might set an identical value.
If writing fails, an exception will still be thrown as expected.
Example
class Foo1 {
public int $bar;
}
One should be able to map a form with bar=123
to Foo1
, but it will fail with UninitializedPropertyException
.
class Foo2 {
private $bar;
public function setBaz($value) {
$this->bar = $value * 2;
}
}
One should be able to map a form with baz=123
to Foo2
, but it will fail with a NoSuchPropertyException
.
Metadata
Metadata
Assignees
Labels
RFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)