-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Symfony version(s) affected: 4.1.2.3
(that's the only version I've checked so far).
Description
A date field is missing from the submitted form data when a value is supplied. This behaviour doesn't happen for form types such as TextType
.
How to reproduce
- Create new project from
symfony/skeleton:v4.1.2.3
. composer req form
- Create JSON payload listener.
- Create form type with date field.
- Create controller (and route definition).
- Start local PHP webserver (
php -S 127.0.0.1:8000 -t public
) - Send test payloads (I used HTTPie via the command:
echo '$DATA' | http --json --print b POST ":8000"
)
Example Payloads
Request Data ($DATA ) |
Response Data |
---|---|
{"my_date":null} |
array(1) { ["my_date"]=> NULL } |
{"my_date":""} |
array(0) { } |
{"my_date":"2018-01-01"} |
array(0) { } |
Possible Solution
Haven't really dug into this yet, I'll update with anything I find.