Skip to content
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.

Already on GitHub? Sign in to your account

[Form] Inconsistant display in TimeType (array mode) #40997

Closed
KDederichs opened this issue Apr 30, 2021 · 1 comment
Closed

[Form] Inconsistant display in TimeType (array mode) #40997

KDederichs opened this issue Apr 30, 2021 · 1 comment

Comments

@KDederichs
Copy link
Contributor

@KDederichs KDederichs commented Apr 30, 2021

Symfony version(s) affected: 5.2.6 (at least)
Description
When you use the TimeType in forms with the input type set to array and then you set different view_timezone and model_timezone options the conversion will be inconsistant. When you load save it the timezone is correct but when you load it it's off.

How to reproduce

  1. Get a TimeType form field
  2. Set input to array
  3. Set model_timezone to UTC
  4. Set view_timezone to Europe/Berlin
  5. Enter a date and save it to a database
  6. Navigate away and reload that value

Possible Solution
https://github.com/symfony/form/blob/8822890bdb6267f8d1c027f697db4bd83c2afc55/Extension/Core/Type/TimeType.php#L208 is not set like it's in line 193, set it and it will work

@carsonbot
Copy link

@carsonbot carsonbot commented Oct 31, 2021

Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

@xabbuh xabbuh added Keep open and removed Stalled labels Nov 3, 2021
xabbuh pushed a commit to KDederichs/symfony that referenced this issue Apr 12, 2022
xabbuh pushed a commit to KDederichs/symfony that referenced this issue Apr 12, 2022
nicolas-grekas added a commit that referenced this issue Apr 12, 2022
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] Use reference date in reverse transform

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40997
| License       | MIT

Use reference time in reverse transform to fix the display inconsistancies

Commits
-------

1a368fc Use reference date in reverse transform Fixes #40997
nicolas-grekas added a commit that referenced this issue Apr 12, 2022
* 4.4:
  [Workflow] Catch error when trying to get an uninitialized marking
  Add missing license header
  Use reference date in reverse transform Fixes #40997
  Fix env resolution in lock configuration
  Fix Symfony not working on SMB share #45990
  [Cache] make LockRegistry use static properties instead of static variables
  fix: return-path has higher priority for envelope address than from address (fixes #41322)
  [HttpClient] Fix sending content-length when streaming the body
  [Console] Header with column max width is now well wrap with separator
  [DependencyInjection] Add TaggedIteratorArgument unit tests
nicolas-grekas added a commit that referenced this issue Apr 12, 2022
* 5.4: (21 commits)
  Add missing license header
  [Workflow] Catch error when trying to get an uninitialized marking
  Add missing license header
  Allow usage of Provider domains if possible
  Use reference date in reverse transform Fixes #40997
  Fix env resolution in lock configuration
  Fix Symfony not working on SMB share #45990
  [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver
  [Cache] make LockRegistry use static properties instead of static variables
  fix: return-path has higher priority for envelope address than from address (fixes #41322)
  [HttpClient] Fix sending content-length when streaming the body
  [Console] Header with column max width is now well wrap with separator
  Fix use_cookies framework session configuration
  [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error …
  [Intl] Update the ICU data to 71.1 - 5.4
  [Intl] Update the ICU data to 71.1 - 4.4
  Add tests to messenger connection get for OraclePlatform
  [RateLimiter] Adding default empty value
  [DependencyInjection] Add TaggedIteratorArgument unit tests
  [Process] Fix Process::getEnv() when setEnv() hasn't been called before
  ...
nicolas-grekas added a commit that referenced this issue Apr 12, 2022
* 6.0: (22 commits)
  Add missing license header
  Add missing license header
  [Workflow] Catch error when trying to get an uninitialized marking
  Add missing license header
  Allow usage of Provider domains if possible
  Use reference date in reverse transform Fixes #40997
  Fix env resolution in lock configuration
  Fix Symfony not working on SMB share #45990
  [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver
  [Cache] make LockRegistry use static properties instead of static variables
  fix: return-path has higher priority for envelope address than from address (fixes #41322)
  [HttpClient] Fix sending content-length when streaming the body
  [Console] Header with column max width is now well wrap with separator
  Fix use_cookies framework session configuration
  [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error …
  [Intl] Update the ICU data to 71.1 - 5.4
  [Intl] Update the ICU data to 71.1 - 4.4
  Add tests to messenger connection get for OraclePlatform
  [RateLimiter] Adding default empty value
  [DependencyInjection] Add TaggedIteratorArgument unit tests
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants