gildegoma opened a new issue #3388: User timezone is forced to UTC when user.timezone is undefined URL: https://github.com/apache/cloudstack/issues/3388 <!-- Verify first that your issue/request is not already reported on GitHub. Also test if the latest release and master branch are affected too. Always add information AFTER of these HTML comments, but no need to delete the comments. --> ##### ISSUE TYPE <!-- Pick one below and delete the rest --> * Bug Report (regression apparently introduced by 0102e8593db435d5fa10d116470a37b220a0a257) ##### COMPONENT NAME <!-- Categorize the issue, e.g. API, VR, VPN, UI, etc. --> ~~~ API (UI) ~~~ ##### CLOUDSTACK VERSION <!-- New line separated list of affected versions, commit ID for issues on master branch. --> ~~~ 4.11.0.0+ 4.12.0.0 ~~~ ##### CONFIGURATION <!-- Information about the configuration if relevant, e.g. basic network, advanced networking, etc. N/A otherwise --> N/A ##### OS / ENVIRONMENT <!-- Information about the environment if relevant, N/A otherwise --> N/A ##### SUMMARY <!-- Explain the problem/feature briefly --> ###### Before CloudStack 4.11.0.0: If the user.timezone is NULL, the API login response doesn't contain any timezoneoffset (nor timezone) attribute. In such situation the Admin Web UI gracefully applies the Web Browser timezone. ###### Since CloudStack 4.11.0.0: If the user.timezone is NULL, the API login response contains timezone and timezoneoffset values by default. For this reason, the Admin Web UI no longer uses the Web Browser timezone, but display date/time values in UTC timezone. ##### STEPS TO REPRODUCE <!-- For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate. For new features, show how the feature would be used. --> * Have a CloudStack user with no timezone setting specified (i.e. `user.timezone` database field must be **NULL**) * Use this user account to log into CloudStack Web UI with a Browser which timezone is different from UTC * Optionally inspect the JSON loginresponse payload, and verify that `timezone == "UTC"` and `timezoneoffset == "0.0"` (see screenshot below) * Go to the **Events** or **Alerts** view and check the *Date* colum. The displayed timezone is UTC.  ##### EXPECTED RESULTS <!-- What did you expect to happen when running the steps above? --> In cases where a CloudStack user profile has no explicit timezone defined, it is expected from the CloudStack Web UI to dynamically fetch and apply the user Web Browser timezone(offset). The [Client-Side JavaScript code still exists](https://github.com/apache/cloudstack/blob/4.11.2.0/ui/scripts/sharedFunctions.js#L1291-L1298), but is only applied when no timezone data is returned by the CloudStack API (see loginresponse JSON payload). In the debugging screenshot below, the code branch starting at line 1291 is expected to be executed, but it is the line 1289 which is executed instead.  ##### ACTUAL RESULTS <!-- What actually happened? --> Since CloudStack 4.11.0.0 (see 0102e8593db435d5fa10d116470a37b220a0a257), the [UserVO implementation has been changed](https://github.com/apache/cloudstack/blob/0102e8593db435d5fa10d116470a37b220a0a257/engine/schema/src/com/cloud/user/UserVO.java#L237-L239) to fallback to `"UTC"` when user.timezone is NULL. This change [affects the API response](https://github.com/apache/cloudstack/blob/b363fd49f70ac2092ebe6226a72a3d911dc99e1f/server/src/main/java/com/cloud/api/ApiServer.java#L1113-L1116) on user authentication, leading the JavaScript UI code to **not fetch the browser timezoneoffset**, but to systematically use UTC timezone. ##### WORKAROUND Explicitely set the user.timezone for each user (who doesn't want to see date/times in UTC timezone)
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
