Closed (fixed)
Project:
Drupal.org customizations
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Sep 2013 at 07:24 UTC
Updated:
23 May 2014 at 18:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
eliza411 commentedThanks for the report!
I'm setting this back to Active for now. Issues should stay as Active until a second person verifies the problem and makes sure there's enough detail for developers to act on the report. (I'd verify now, but the site is being rebuilt).
Unfortunately, the status settings don't quite fit the work we're doing. In a perfect world we'd have a "verified" setting.
Comment #2
eliza411 commentedI tried to reproduce this by:
That worked as expected, but I imagine there are many other places where time comes into play.
Can you share the URL and describe what wasn't working as expected?
Comment #3
vinoth.3v commentedI think the issue title is misleading.
in d.o(d6), I have my user time zone set to +5.30 (Asia/kolkatta), but in d.o(D7) it was wrong.
Comment #4
eliza411 commentedThanks for clarifying. I updated the title to make it more clear (I hope).
I definitely see a difference in the way time zones are selected (Region/City - UTC offset on git7site, UTC offset on drupal.org). I'm not sure if this was intentional, but I'll set this to "needs review" so we can find out.
Comment #4.0
eliza411 commentededit
Comment #5
a.ross commentedThis has to do with the timezones supported by PHP. Named timezones have only been supported since PHP5, and therefore Drupal 6 does not support them. I don't know how the migration is handled exactly, but that is the root of the issue.
Here's an example in the API to show what I mean:
https://api.drupal.org/api/drupal/includes!common.inc/function/format_date/6
https://api.drupal.org/api/drupal/includes!common.inc/function/format_date/7
Comment #6
helmo commentedThe node creation time of a random issue (e.g. this one) also clearly showed it:
Looking at my profile page I noticed that my setting on the D6 site was wrong. It was on utc +1, while http://en.wikipedia.org/wiki/Daylight_saving_time brings Europe to UTC +2
After changing the setting on D6
Comment #7
jthorson commentedTimezones definitely are not being migrated ...
Comment #8
jthorson commenteduser_update_7002() handles converting user timezones during the upgrade. Unfortunately, it only attempts to update timezones if the contrib date or event modules have been installed; and if not, it simply sets the timezone to NULL.
So it looks like our options are:
1) Install the date module, so that the timezone_name column exists in the users table (though I'm not sure if the conversions actually get created when the column is added, or simply updated on user_save()), orUpdate: Looks like the date 6.x-1.x module only populates this column at user login.2) Leave the user timezones as NULL, and enable the 'Remind users at login if their timezone is not set' setting at admin/config/regional/settings, or
3) Build some sort of custom migration script which attempts to 'guess' the user timezone based on their configured offset. (Example: http://drupal.stackexchange.com/questions/37006/convert-d6-user-timezone...)
Comment #9
jthorson commentedHmmm ... we can't create the timezone_name column from within a drupalorg hook_update_N() function, because this would create a circular dependency (drupalorg_update_7000 depends on user_update_7018(), and we want to sneak in before user_update_7002()).
Based on this, the only way to accomplish #3 will be via a D6 'pre-upgrade' module, which:
i) performs the logic in the linked stackexchange answer to create a mapping of offsets to timezones,
ii) adds a 'timezone_name' column to the users table, and
iii) Iterates across all users, reading their offset value, and writing a best guess timezone into the timezone_name file.
If this is done before the upgrade, then user_update_7002() will then migrate across the timezone_name values, after which the added column can be manually deleted. (Normally it would be deleted by the date_update() functions, which we don't have in this case.)
Comment #10
a.ross commentedWhat is the success rate of the best guess timezone? I'd think it will often be inaccurate, so it may be better to remind the users to set their timezones.
Comment #11
jthorson commentedGiven that setting the user timezone to NULL is core's default behavior for D6 to D7 upgrades, and we can't accurately convert each timezone offset to a user's true timezone, we're going to simply enable the "Remind users at login if their time zone is not set" configuration setting.
As a result, when a user logs in and doesn't have a timezone explicitly set, they will be taken directly to their profile edit page and prompted to update their timezone settings.
Comment #12
tvn commentedComment #13
drummCommitted.
Comment #13.0
drummUpdate with examples