Bug 1070317 - Bugzilla::Flag's attribute modification_date is affected by the…

Bug 1070317 - Bugzilla::Flag's attribute modification_date is affected by the user's timezone and differs from the database copy after a call to $flag->update() r=dkl, a=justdave
parent 392fcaf5
...@@ -455,14 +455,15 @@ sub create { ...@@ -455,14 +455,15 @@ sub create {
sub update { sub update {
my $self = shift; my $self = shift;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $timestamp = shift || $dbh->selectrow_array('SELECT NOW()'); my $timestamp = shift || $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
my $changes = $self->SUPER::update(@_); my $changes = $self->SUPER::update(@_);
if (scalar(keys %$changes)) { if (scalar(keys %$changes)) {
$dbh->do('UPDATE flags SET modification_date = ? WHERE id = ?', $dbh->do('UPDATE flags SET modification_date = ? WHERE id = ?',
undef, ($timestamp, $self->id)); undef, ($timestamp, $self->id));
$self->{'modification_date'} = format_time($timestamp, '%Y.%m.%d %T'); $self->{'modification_date'} =
format_time($timestamp, '%Y.%m.%d %T', Bugzilla->local_timezone);
} }
return $changes; return $changes;
} }
......
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