- Issue created by @Cayenne
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
Please provide your suggested change in a merge request. It would be great if you can add a test that surfaces this problem.
- πΊπΈUnited States bluegeek9
The error happens when $element is NULL.
The proposed change does not work like the existing code.
In the existing code , any '#default_value' already set will be preserved.
- πΊπ¦Ukraine Tyapchyc
@cayenne Could you provide an example of your custom code?
The next code works fine.
$form['name_field'] = [ '#type' => 'name', '#default_value' => [], ];
or
$form['name_field'] = [ '#type' => 'name', '#default_value' => [ 'given' => 'Default given', ], ];
Thanks.