You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If you pass a reference time to a TimeType field with input type array it will assume the time properties of the reference date when the field value was 0
Not the reference_date, the minutes or hours, but it's related to this: #40998
So all of this only happens if you set a reference_date with differentiating input and model timezones in array mode.
As I described in that issue though I'm not 100% sure if it should be a thing you can do anyways.
…clude 0 (Kai Dederichs)
This PR was submitted for the 5.2 branch but it was squashed and merged into the 4.4 branch instead.
Discussion
----------
[Form] Use !isset for checks cause this doesn't falsely include 0
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40999
| License | MIT
By using isset 0 won't falsely included anymore
Commits
-------
cd541c5 [Form] Use !isset for checks cause this doesn't falsely include 0
Symfony version(s) affected: 5.2.6 (probably others)
Description
If you pass a reference time to a TimeType field with input type array it will assume the time properties of the reference date when the field value was 0
How to reproduce
Possible Solution
It's caused by https://github.com/symfony/form/blob/8822890bdb6267f8d1c027f697db4bd83c2afc55/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php#L170 cause empty views 0 as empty value and will thus take the value of the reference date
The text was updated successfully, but these errors were encountered: