Closed cboelter closed 6 years ago
If you bind the model, the model is the master. Default values should be represented by the model too, otherwise what happens if I do something like this:
$model = new FoobarModel();
echo $model->salutation;
? It will not show mrs
but it should ;-)
I'm using the Form class with a bound Contao Model. If I want to set the default value of a field in the dca configuration like this:
The default value will be overwritten every time with the model value, even it is currently empty.
To fix this, I have changed this line: https://github.com/codefog/contao-haste/blob/master/library/Haste/Form/Form.php#L414 to the following:
So the model value is only used, if there is a value for the field. Is this a bug or is there another way to set the default value?