Moodle

New Olson timezone files require dst_time and std_time fields of size 6 instead of 5

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.3, 1.9, 2.0
  • Fix Version/s: 1.8.4, 1.9, 2.0
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Environment:
    Linux 2.6.22, Ubuntu 7.10, Postgres 8.1
  • Database:
    PostgreSQL
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

Description

These patches upgrade dst_time and std_time fields in timezone to varchar(6)

These fields were varchar(5) and that's too small to upgrade using the latest Olson data (which contains the new daylight saving rules for New Zealand for example).

The patches apply cleanly against:

  • MOODLE_18_STABLE
  • MOODLE_19_STABLE
  • CVSHEAD

Francois

  1. timezone_fields_18STABLE.patch
    05/Nov/07 2:37 PM
    4 kB
    Francois Marier
  2. timezone_fields_19STABLE.patch
    05/Nov/07 2:37 PM
    4 kB
    Francois Marier
  3. timezone_fields_CVSHEAD.patch
    05/Nov/07 2:37 PM
    4 kB
    Francois Marier

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Ops,

sorry by the delay!

Just looked patches and...err... uhm... the upgrade.php scripts aren't correct. They are using the old (deprecated) table_column() that isn't cross-db at all. Should use new ddl stuff exclusively, like the proposed by the XMLDB editor.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Ops, sorry by the delay! Just looked patches and...err... uhm... the upgrade.php scripts aren't correct. They are using the old (deprecated) table_column() that isn't cross-db at all. Should use new ddl stuff exclusively, like the proposed by the XMLDB editor. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Francois,

are you going to perform this... or should I do it ? (no problem with any alternative)

TIA and ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Francois, are you going to perform this... or should I do it ? (no problem with any alternative) TIA and ciao
Hide
Francois Marier added a comment -

After discussing this with MattC and Eloy, there is another problem that we need to watch out for:

  • the timezone.txt file distributed by moodle.org needs to be truncated to 5 characters, otherwise updates with older versions will fail

So the simplest solution would be to rename the file to "timezone2.txt" and to keep the old file around for backwards compatibility.

A better solution would be to use mod_rewrite to generate timezone.txt dynamically. With this solution, a version number could optionally be passed and a 6-character timezone file would be returned for the new Moodle versions. We could keep truncating the olson data to 5 characters to provide some kind of support for older Moodle installs.

And as Matt was saying: "if the timezone file on moodle.org was to be re-generated automatically from the latest olson DB file too it would save someone having to remember to updated it (or deal with bugs about it being out of date)"

Show
Francois Marier added a comment - After discussing this with MattC and Eloy, there is another problem that we need to watch out for:
  • the timezone.txt file distributed by moodle.org needs to be truncated to 5 characters, otherwise updates with older versions will fail
So the simplest solution would be to rename the file to "timezone2.txt" and to keep the old file around for backwards compatibility. A better solution would be to use mod_rewrite to generate timezone.txt dynamically. With this solution, a version number could optionally be passed and a 6-character timezone file would be returned for the new Moodle versions. We could keep truncating the olson data to 5 characters to provide some kind of support for older Moodle installs. And as Matt was saying: "if the timezone file on moodle.org was to be re-generated automatically from the latest olson DB file too it would save someone having to remember to updated it (or deal with bugs about it being out of date)"
Hide
Francois Marier added a comment -

From Skype discussion, Eloy lists the next steps:
1) Move HEAD timezones.txt back to 17_STABLE timezones.txt (if are different right now).
2) Keep < 1.8 working against that file in download.moodle.org/timezones
3) Apply the patch to 18. 19 and HEAD, pointing to new URL
4) Make new URL to server HEAD timezones.
5) update HEAD timezones to new records (having 6cc entries)

Show
Francois Marier added a comment - From Skype discussion, Eloy lists the next steps: 1) Move HEAD timezones.txt back to 17_STABLE timezones.txt (if are different right now). 2) Keep < 1.8 working against that file in download.moodle.org/timezones 3) Apply the patch to 18. 19 and HEAD, pointing to new URL 4) Make new URL to server HEAD timezones. 5) update HEAD timezones to new records (having 6cc entries)
Hide
Eloy Lafuente (stronk7) added a comment -

I'll try to implement this tomorrow if nobody has anything against it. Ciao

Show
Eloy Lafuente (stronk7) added a comment - I'll try to implement this tomorrow if nobody has anything against it. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

First part done:

Now 18_STABLE, 19_STABLE and HEAD have varchar(6) in those timezone fields.

Now the second part. What I've planned is:

1) Backport current HEAD timezones.txt to 16_STABLE and 17_STABLE
2) Make the current URL: http://download.moodle.org/timezones to return 17_STABLE timezones

(with these 2 points it's guaranteed that moodle versions < 1.8 will always use old varchar(5) olson files)

3) Create one new URL: http://download.moodle.org/timezones_info to return HEAD timezones.
4) Point 18_STABLE, 19_STABLE and HEAD to that new location

(with these 2 points, all moodle versions >= 1.8 will use the new varchar(6) olson files, so we'll be able to update them).

An alternative to this separated URLs is to use a common one, but using some parameter. But I think it's clear to keep them separated.

Any comment / idea... ?

I'll wait a few days until receiving some feedback from MD. After all, those URLs are pointing to his servers, hehe.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - First part done: Now 18_STABLE, 19_STABLE and HEAD have varchar(6) in those timezone fields. Now the second part. What I've planned is: 1) Backport current HEAD timezones.txt to 16_STABLE and 17_STABLE 2) Make the current URL: http://download.moodle.org/timezones to return 17_STABLE timezones (with these 2 points it's guaranteed that moodle versions < 1.8 will always use old varchar(5) olson files) 3) Create one new URL: http://download.moodle.org/timezones_info to return HEAD timezones. 4) Point 18_STABLE, 19_STABLE and HEAD to that new location (with these 2 points, all moodle versions >= 1.8 will use the new varchar(6) olson files, so we'll be able to update them). An alternative to this separated URLs is to use a common one, but using some parameter. But I think it's clear to keep them separated. Any comment / idea... ? I'll wait a few days until receiving some feedback from MD. After all, those URLs are pointing to his servers, hehe. Ciao
Hide
Martin Dougiamas added a comment -

Yes, better to make a new location I think.

I would just suggest calling it /lib/timezone.txt and http://download.moodle.org/timezone/ instead.

Show
Martin Dougiamas added a comment - Yes, better to make a new location I think. I would just suggest calling it /lib/timezone.txt and http://download.moodle.org/timezone/ instead.
Hide
Petr Škoda (skodak) added a comment -

binary downloads working again in 19dev...

Show
Petr Škoda (skodak) added a comment - binary downloads working again in 19dev...
Hide
Eloy Lafuente (stronk7) added a comment -

Done. Now:

Moodle <= 17_STABLE is using the old "timezones" locations.
Moodle >= 18_STABLE is using the new "timezone" locations.

Timezones information updated from ftp://elsie.nci.nih.gov/pub/ (2007j data), with zones from africa, antarctica,
asia, australasia, europe, northamerica and southamerica (1976 rules).

Closing...ciao

Show
Eloy Lafuente (stronk7) added a comment - Done. Now: Moodle <= 17_STABLE is using the old "timezones" locations. Moodle >= 18_STABLE is using the new "timezone" locations. Timezones information updated from ftp://elsie.nci.nih.gov/pub/ (2007j data), with zones from africa, antarctica, asia, australasia, europe, northamerica and southamerica (1976 rules). Closing...ciao

Dates

  • Created:
    Updated:
    Resolved: