diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index e2ca0e92e..3a9e805a2 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -480,6 +480,7 @@ sub update my $delta_ts = shift || $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); # You can't set these fields by hand + $self->{deadline} =~ s/\s+.*$//so; $self->{delta_ts} = $delta_ts; delete $self->{votes}; delete $self->{lastdiffed}; @@ -498,7 +499,8 @@ sub update if ($self->id) { - ($changes, $old_bug) = $self->SUPER::update(@_); + $old_bug->{deadline} =~ s/\s+.*$//so; + ($changes, $old_bug) = $self->SUPER::update(undef, $old_bug); } else { diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 4b2d07690..11e4b44f3 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -334,6 +334,7 @@ sub set_all sub update { my $self = shift; + my (undef, $old_self) = @_; my $dbh = Bugzilla->dbh; my $table = $self->DB_TABLE; @@ -342,7 +343,7 @@ sub update $dbh->bz_start_transaction(); # Use a copy of old object - my $old_self = $self->new($self->id); + $old_self ||= $self->new($self->id); my $numeric = $self->NUMERIC_COLUMNS; my $date = $self->DATE_COLUMNS;