summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorFrank Becker <Frank@Frank-Becker.de>2010-03-30 12:18:13 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2010-03-30 12:18:13 +0200
commitad7a26c7572f5969a895d6186b2c88b32f99b3c9 (patch)
tree275579cef21116e65dae430639bc755214146e66 /process_bug.cgi
parentcfc6c3ff36609642055cc5b317212df1675b70f4 (diff)
downloadbugzilla-ad7a26c7572f5969a895d6186b2c88b32f99b3c9.tar.gz
bugzilla-ad7a26c7572f5969a895d6186b2c88b32f99b3c9.tar.xz
Bug 515515: For clients, mid-air collision results when user's timezone preference differs from server's
r=mkanat r=LpSolit a=LpSolit
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi47
1 files changed, 25 insertions, 22 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index d16298df6..39526b3ff 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -153,30 +153,33 @@ print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_EMAIL;
# Check for a mid-air collision. Currently this only works when updating
# an individual bug.
-if (defined $cgi->param('delta_ts')
- && $cgi->param('delta_ts') ne $first_bug->delta_ts)
+if (defined $cgi->param('delta_ts'))
{
- ($vars->{'operations'}) =
- Bugzilla::Bug::GetBugActivity($first_bug->id, undef,
- scalar $cgi->param('delta_ts'));
-
- $vars->{'title_tag'} = "mid_air";
-
- ThrowCodeError('undefined_field', { field => 'longdesclength' })
- if !defined $cgi->param('longdesclength');
-
- $vars->{'start_at'} = $cgi->param('longdesclength');
- # Always sort midair collision comments oldest to newest,
- # regardless of the user's personal preference.
- $vars->{'comments'} = $first_bug->comments({ order => "oldest_to_newest" });
- $vars->{'bug'} = $first_bug;
- # 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]));
+ 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'}) =
+ Bugzilla::Bug::GetBugActivity($first_bug->id, undef,
+ scalar $cgi->param('delta_ts'));
+
+ $vars->{'title_tag'} = "mid_air";
- # Warn the user about the mid-air collision and ask them what to do.
- $template->process("bug/process/midair.html.tmpl", $vars)
- || ThrowTemplateError($template->error());
- exit;
+ ThrowCodeError('undefined_field', { field => 'longdesclength' })
+ if !defined $cgi->param('longdesclength');
+
+ $vars->{'start_at'} = $cgi->param('longdesclength');
+ # Always sort midair collision comments oldest to newest,
+ # regardless of the user's personal preference.
+ $vars->{'comments'} = $first_bug->comments({ order => "oldest_to_newest" });
+ $vars->{'bug'} = $first_bug;
+
+ # 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]));
+ # Warn the user about the mid-air collision and ask them what to do.
+ $template->process("bug/process/midair.html.tmpl", $vars)
+ || ThrowTemplateError($template->error());
+ exit;
+ }
}
# We couldn't do this check earlier as we first had to validate bug IDs