Commit ad7a26c7 authored by Frank Becker's avatar Frank Becker Committed by Frédéric Buclin

Bug 515515: For clients, mid-air collision results when user's timezone…

Bug 515515: For clients, mid-air collision results when user's timezone preference differs from server's r=mkanat r=LpSolit a=LpSolit
parent cfc6c3ff
...@@ -153,9 +153,11 @@ print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_EMAIL; ...@@ -153,9 +153,11 @@ print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_EMAIL;
# Check for a mid-air collision. Currently this only works when updating # Check for a mid-air collision. Currently this only works when updating
# an individual bug. # an individual bug.
if (defined $cgi->param('delta_ts') if (defined $cgi->param('delta_ts'))
&& $cgi->param('delta_ts') ne $first_bug->delta_ts)
{ {
my $delta_ts_z = datetime_from($cgi->param('delta_ts'));
my $first_delta_tz_z = datetime_from($first_bug->delta_ts);
if ($first_delta_tz_z ne $delta_ts_z) {
($vars->{'operations'}) = ($vars->{'operations'}) =
Bugzilla::Bug::GetBugActivity($first_bug->id, undef, Bugzilla::Bug::GetBugActivity($first_bug->id, undef,
scalar $cgi->param('delta_ts')); scalar $cgi->param('delta_ts'));
...@@ -170,13 +172,14 @@ if (defined $cgi->param('delta_ts') ...@@ -170,13 +172,14 @@ if (defined $cgi->param('delta_ts')
# regardless of the user's personal preference. # regardless of the user's personal preference.
$vars->{'comments'} = $first_bug->comments({ order => "oldest_to_newest" }); $vars->{'comments'} = $first_bug->comments({ order => "oldest_to_newest" });
$vars->{'bug'} = $first_bug; $vars->{'bug'} = $first_bug;
# The token contains the old delta_ts. We need a new one. # The token contains the old delta_ts. We need a new one.
$cgi->param('token', issue_hash_token([$first_bug->id, $first_bug->delta_ts])); $cgi->param('token', issue_hash_token([$first_bug->id, $first_bug->delta_ts]));
# Warn the user about the mid-air collision and ask them what to do. # Warn the user about the mid-air collision and ask them what to do.
$template->process("bug/process/midair.html.tmpl", $vars) $template->process("bug/process/midair.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
exit; exit;
}
} }
# We couldn't do this check earlier as we first had to validate bug IDs # We couldn't do this check earlier as we first had to validate bug IDs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment