buglists exported as iCalendar have wrong timestamps

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
Query/Bug List
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

2.23.3
Bugzilla 3.0
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
Created attachment 254573 [details] [diff] [review]
patch, v1

When exported in the iCalendar format, buglists must be exported using the GMT (aka Zulu) timezone, but Bugzilla exports them using the local timezone and appends "Z" (Zulu) without converting timestamps first.

This makes applications such as Sunbird to collect wrong dates and times.

I tested my patch on landfill/qa30 for both Atom feeds and iCalendar lists, and I found no regression. ;)
Attachment #254573 - Flags: review?(myk)
Comment on attachment 254573 [details] [diff] [review]
patch, v1

>Index: buglist.cgi

>-        $bug->{'changedtime'} = str2time($bug->{'changeddate'});
>+        $bug->{'changedtime'} = str2time($bug->{'changeddate'}, Bugzilla->params->{'timezone'});

...

>-        $bug->{'opentime'} = str2time($bug->{'opendate'});
>+        $bug->{'opentime'} = str2time($bug->{'opendate'}, Bugzilla->params->{'timezone'});

What happens when the "timezone" parameter is empty or contains an invalid value?


>Index: template/en/default/list/list.ics.tmpl

Nit: use UTC instead of GMT (which is deprecated).

Note that list.csv.tmpl and list.atom.tmpl are also using date.format and should also be switched over to time2str, although that can be done in a different bug.

r=myk
Attachment #254573 - Flags: review?(myk) → review+
One more note: Template.pm asks whether we should replace time2str with TT's Date plugin.  We should remove that question and add a comment saying not to use the Date plugin because of this issue.
(Assignee)

Comment 3

11 years ago
(In reply to comment #1)

> What happens when the "timezone" parameter is empty or contains an invalid
> value?

It cannot be invalid. editparams.cgi validates the timezone. If it's empty, it will behave exactly the same way as now, i.e. will consider the local timezone.
(Assignee)

Comment 4

11 years ago
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.351; previous revision: 1.350
done
Checking in template/en/default/list/list.ics.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/list.ics.tmpl,v  <--  list.ics.tmpl
new revision: 1.6; previous revision: 1.5
done
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Flags: approval+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.