summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Attachment.pm1
-rw-r--r--Bugzilla/Bug.pm1
-rw-r--r--Bugzilla/BugUrl.pm4
-rw-r--r--Bugzilla/Comment.pm4
-rw-r--r--Bugzilla/Flag.pm2
-rw-r--r--Bugzilla/Object.pm6
-rw-r--r--Bugzilla/Search/Recent.pm4
-rw-r--r--Bugzilla/Search/Saved.pm4
8 files changed, 23 insertions, 3 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index 189073d54..2ab494eec 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -55,6 +55,7 @@ use constant DB_TABLE => 'attachments';
use constant ID_FIELD => 'attach_id';
use constant LIST_ORDER => ID_FIELD;
# Attachments are tracked in bugs_activity.
+use constant AUDIT_CREATES => 0;
use constant AUDIT_UPDATES => 0;
sub DB_COLUMNS {
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 2fe9cc1a6..aeb2e16b7 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -51,6 +51,7 @@ use constant ID_FIELD => 'bug_id';
use constant NAME_FIELD => 'alias';
use constant LIST_ORDER => ID_FIELD;
# Bugs have their own auditing table, bugs_activity.
+use constant AUDIT_CREATES => 0;
use constant AUDIT_UPDATES => 0;
# This is a sub because it needs to call other subroutines.
diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm
index 7778a4d7e..1272b55fa 100644
--- a/Bugzilla/BugUrl.pm
+++ b/Bugzilla/BugUrl.pm
@@ -22,6 +22,10 @@ use URI::QueryParam;
use constant DB_TABLE => 'bug_see_also';
use constant NAME_FIELD => 'value';
use constant LIST_ORDER => 'id';
+# See Also is tracked in bugs_activity.
+use constant AUDIT_CREATES => 0;
+use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
use constant DB_COLUMNS => qw(
id
diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm
index 5f3d118f8..549753d2b 100644
--- a/Bugzilla/Comment.pm
+++ b/Bugzilla/Comment.pm
@@ -23,7 +23,9 @@ use Scalar::Util qw(blessed);
#### Initialization ####
###############################
-# Updates of comments are audited in bugs_activity instead of audit_log.
+# Creation and updating of comments are audited in longdescs
+# and bugs_activity respectively instead of audit_log.
+use constant AUDIT_CREATES => 0;
use constant AUDIT_UPDATES => 0;
use constant DB_COLUMNS => qw(
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index ba2c840cc..0ea49a4b7 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -59,7 +59,9 @@ use base qw(Bugzilla::Object Exporter);
use constant DB_TABLE => 'flags';
use constant LIST_ORDER => 'id';
# Flags are tracked in bugs_activity.
+use constant AUDIT_CREATES => 0;
use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
use constant SKIP_REQUESTEE_ON_ERROR => 1;
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm
index 19297e143..1b0af509d 100644
--- a/Bugzilla/Object.pm
+++ b/Bugzilla/Object.pm
@@ -29,7 +29,9 @@ use constant VALIDATOR_DEPENDENCIES => {};
# XXX At some point, this will be joined with FIELD_MAP.
use constant REQUIRED_FIELD_MAP => {};
use constant EXTRA_REQUIRED_FIELDS => ();
+use constant AUDIT_CREATES => 1;
use constant AUDIT_UPDATES => 1;
+use constant AUDIT_REMOVES => 1;
# This allows the JSON-RPC interface to return Bugzilla::Object instances
# as though they were hashes. In the future, this may be modified to return
@@ -397,7 +399,7 @@ sub remove_from_db {
my $id_field = $self->ID_FIELD;
my $dbh = Bugzilla->dbh;
$dbh->bz_start_transaction();
- $self->audit_log(AUDIT_REMOVE);
+ $self->audit_log(AUDIT_REMOVE) if $self->AUDIT_REMOVES;
$dbh->do("DELETE FROM $table WHERE $id_field = ?", undef, $self->id);
$dbh->bz_commit_transaction();
undef $self;
@@ -545,7 +547,7 @@ sub insert_create_data {
Bugzilla::Hook::process('object_end_of_create', { class => $class,
object => $object });
- $object->audit_log(AUDIT_CREATE);
+ $object->audit_log(AUDIT_CREATE) if $object->AUDIT_CREATES;
return $object;
}
diff --git a/Bugzilla/Search/Recent.pm b/Bugzilla/Search/Recent.pm
index cea086444..02c3ec37a 100644
--- a/Bugzilla/Search/Recent.pm
+++ b/Bugzilla/Search/Recent.pm
@@ -19,6 +19,10 @@ use Bugzilla::Util;
use constant DB_TABLE => 'profile_search';
use constant LIST_ORDER => 'id DESC';
+# Do not track buglists viewed by users.
+use constant AUDIT_CREATES => 0;
+use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
use constant DB_COLUMNS => qw(
id
diff --git a/Bugzilla/Search/Saved.pm b/Bugzilla/Search/Saved.pm
index bb8b62a92..f7d5971d4 100644
--- a/Bugzilla/Search/Saved.pm
+++ b/Bugzilla/Search/Saved.pm
@@ -26,6 +26,10 @@ use Scalar::Util qw(blessed);
#############
use constant DB_TABLE => 'namedqueries';
+# Do not track buglists saved by users.
+use constant AUDIT_CREATES => 0;
+use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
use constant DB_COLUMNS => qw(
id