diff options
Diffstat (limited to 'Bugzilla')
-rwxr-xr-x | Bugzilla/Bug.pm | 14 | ||||
-rw-r--r-- | Bugzilla/BugMail.pm | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 810b1daf9..aa5ad5a83 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -54,6 +54,7 @@ use base qw(Exporter); RemoveVotes CheckIfVotedConfirmed LogActivityEntry is_open_state + editable_bug_fields ); ##################################################################### @@ -731,6 +732,19 @@ sub AppendComment { $dbh->do("UPDATE bugs SET delta_ts = ? WHERE bug_id = ?", undef, $timestamp, $bugid); } + +# Represents which fields from the bugs table are handled by process_bug.cgi. +sub editable_bug_fields { + my @fields = Bugzilla->dbh->bz_table_columns('bugs'); + foreach my $remove ("bug_id", "creation_ts", "delta_ts", "lastdiffed") { + my $location = lsearch(\@fields, $remove); + splice(@fields, $location, 1); + } + # Sorted because the old @::log_columns variable, which this replaces, + # was sorted. + return sort(@fields); +} + # This method is private and is not to be used outside of the Bug class. sub EmitDependList { my ($myfield, $targetfield, $bug_id) = (@_); diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index ab8ca2f6f..7bfefd628 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -131,7 +131,7 @@ sub ProcessOneBug { } my %values = %{$dbh->selectrow_hashref( - 'SELECT ' . join(',', @::log_columns) . ', + 'SELECT ' . join(',', editable_bug_fields()) . ', lastdiffed AS start, LOCALTIMESTAMP(0) AS end FROM bugs WHERE bug_id = ?', undef, $id)}; |