-
8000
-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] deprecate using the date and time types with date objects with not-matching timezones #46426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails. 8000 p>
Already on GitHub? Sign in to your account
[Form] deprecate using the date and time types with date objects with not-matching timezones #46426
Conversation
edited
Q | A |
---|---|
Branch? | 6.4 |
Bug fix? | no |
New feature? | no |
Deprecations? | yes |
Tickets | |
License | MIT |
Doc PR |
97a0564
to
95e119b
Compare
Status: Needs Review |
EDIT: no model transformation to hook into for such cases |
Should we create a dedicated listener that can be used in other |
bc464f2
to
9baadc8
Compare
9baadc8
to
bf7222a
Compare
I don't think we need to extract this into a dedicated listener, but you are right that we should trigger the deprecation in these types as well. I have updated the code accordingly. Status: Needs Review |
4a73df7
to
3317b72
Compare
Is this one ready for another round of reviews? |
949df05
to
ec03721
Compare
Yes, the PR is ready to be reviewed again. |
} | ||
|
||
if ($date->getTimezone()->getName() !== $options['model_timezone']) { | ||
trigger_deprecation('symfony/form', '6.3', sprintf('Using a "%s" instance with a timezone ("%s") not matching the configured model timezone "%s" is deprecated.', $date::class, $date->getTimezone()->getName(), $options['model_timezone'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing some inline comment to know what to do with this in 7.0.
Are we going to throw something? If yes, can we add the anticipated line as a comment already?
Same for tests: how should they be changed in 7.0? Let's add some commented expectException?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
friendly ping @xabbuh :) |
7b782eb
to
1c78bae
Compare
1c78bae
to
b78bfbc
Compare
Thank you @xabbuh. |
Hi guys, This change is breaking our app because Having to normalize the timezone of a hundred of Can you elaborate on the issues that prompted this PR? In short, is throwing an exception to the face of the user the right approach? |
@fmarchalemisys Please open a new issue. Comments on merged PRs are likely to get lost. |