summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-16 22:37:49 +0200
committerlpsolit%gmail.com <>2006-06-16 22:37:49 +0200
commitd9548f66b0f47af651f8fa62fa69cc7e65df0a60 (patch)
tree80c1c5e677910413e87e7dd828b55ed2979d6e49 /Bugzilla
parentf35e18b585fd8c2604e43d1fbdf53a36bf77e804 (diff)
downloadbugzilla-d9548f66b0f47af651f8fa62fa69cc7e65df0a60.tar.gz
bugzilla-d9548f66b0f47af651f8fa62fa69cc7e65df0a60.tar.xz
Bug 328438: Eliminate @::log_columns - Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit a=myk
Diffstat (limited to 'Bugzilla')
-rwxr-xr-xBugzilla/Bug.pm14
-rw-r--r--Bugzilla/BugMail.pm2
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)};