diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/ComponentWatching/Extension.pm | 4 | ||||
-rw-r--r-- | extensions/ContributorEngagement/Extension.pm | 4 | ||||
-rw-r--r-- | extensions/EditComments/Extension.pm | 4 | ||||
-rw-r--r-- | extensions/RestrictComments/Extension.pm | 4 | ||||
-rw-r--r-- | extensions/Review/Extension.pm | 6 | ||||
-rw-r--r-- | extensions/SecureMail/Extension.pm | 2 | ||||
-rw-r--r-- | extensions/TagNewUsers/Extension.pm | 15 | ||||
-rw-r--r-- | extensions/UserProfile/Extension.pm | 4 |
8 files changed, 30 insertions, 13 deletions
diff --git a/extensions/ComponentWatching/Extension.pm b/extensions/ComponentWatching/Extension.pm index 526ba1c5e..ed47e64c3 100644 --- a/extensions/ComponentWatching/Extension.pm +++ b/extensions/ComponentWatching/Extension.pm @@ -158,7 +158,9 @@ sub object_columns { my $columns = $args->{columns}; return unless $class->isa('Bugzilla::Component'); - push(@$columns, 'watch_user'); + if (Bugzilla->dbh->bz_column_info($class->DB_TABLE, 'watch_user')) { + push @$columns, 'watch_user'; + } } sub object_update_columns { diff --git a/extensions/ContributorEngagement/Extension.pm b/extensions/ContributorEngagement/Extension.pm index c5ce29966..35eba24ab 100644 --- a/extensions/ContributorEngagement/Extension.pm +++ b/extensions/ContributorEngagement/Extension.pm @@ -71,8 +71,8 @@ sub object_columns { my ($class, $columns) = @$args{qw(class columns)}; if ($class->isa('Bugzilla::User')) { my $dbh = Bugzilla->dbh; - if ($dbh->bz_column_info('profiles', 'first_patch_reviewed_id')) { - push(@$columns, 'first_patch_reviewed_id'); + if ($dbh->bz_column_info($class->DB_TABLE, 'first_patch_reviewed_id')) { + push @$columns, 'first_patch_reviewed_id'; } } } diff --git a/extensions/EditComments/Extension.pm b/extensions/EditComments/Extension.pm index ab19ab6e7..e2ace3f23 100644 --- a/extensions/EditComments/Extension.pm +++ b/extensions/EditComments/Extension.pm @@ -191,7 +191,9 @@ sub object_columns { my ($self, $args) = @_; my ($class, $columns) = @$args{qw(class columns)}; if ($class->isa('Bugzilla::Comment')) { - push(@$columns, 'edit_count'); + if (Bugzilla->dbh->bz_column_info($class->DB_TABLE, 'edit_count')) { + push @$columns, 'edit_count'; + } } } diff --git a/extensions/RestrictComments/Extension.pm b/extensions/RestrictComments/Extension.pm index 213a1c44a..e93540d5a 100644 --- a/extensions/RestrictComments/Extension.pm +++ b/extensions/RestrictComments/Extension.pm @@ -68,7 +68,9 @@ sub object_columns { my ($self, $args) = @_; my ($class, $columns) = @$args{qw(class columns)}; if ($class->isa('Bugzilla::Bug')) { - push(@$columns, 'restrict_comments'); + if (Bugzilla->dbh->bz_column_info($class->DB_TABLE, 'restrict_comments')) { + push @$columns, 'restrict_comments'; + } } } diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm index 967679eed..576c31c7e 100644 --- a/extensions/Review/Extension.pm +++ b/extensions/Review/Extension.pm @@ -284,12 +284,14 @@ sub object_columns { my ($self, $args) = @_; my ($class, $columns) = @$args{qw(class columns)}; if ($class->isa('Bugzilla::Product')) { - push @$columns, 'reviewer_required'; + my $dbh = Bugzilla->dbh; + my @new_columns = qw(reviewer_required); + push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns; } elsif ($class->isa('Bugzilla::User')) { my $dbh = Bugzilla->dbh; my @new_columns = qw(review_request_count feedback_request_count needinfo_request_count); - push @$columns, grep { $dbh->bz_column_info(Bugzilla::User->DB_TABLE, $_ } @new_columns; + push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns; } } diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm index 02714a230..1595fe98c 100644 --- a/extensions/SecureMail/Extension.pm +++ b/extensions/SecureMail/Extension.pm @@ -103,7 +103,7 @@ sub object_columns { if ($class->isa('Bugzilla::Group')) { my $dbh = Bugzilla->dbh; - if ($dbh->bz_column_info(Bugzilla::Group->DB_TABLE, 'secure_mail')) { + if ($dbh->bz_column_info($class->DB_TABLE, 'secure_mail')) { push @$columns, 'secure_mail'; } } diff --git a/extensions/TagNewUsers/Extension.pm b/extensions/TagNewUsers/Extension.pm index b94873979..1810f204f 100644 --- a/extensions/TagNewUsers/Extension.pm +++ b/extensions/TagNewUsers/Extension.pm @@ -123,7 +123,9 @@ sub object_columns { my ($self, $args) = @_; my ($class, $columns) = @$args{qw(class columns)}; if ($class->isa('Bugzilla::User')) { - push(@$columns, qw(comment_count creation_ts first_patch_bug_id)); + my $dbh = Bugzilla->dbh; + my @new_columns = qw(comment_count creation_ts first_patch_bug_id); + push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns; } } @@ -131,9 +133,14 @@ sub object_before_create { my ($self, $args) = @_; my ($class, $params) = @$args{qw(class params)}; if ($class->isa('Bugzilla::User')) { - my ($timestamp) = Bugzilla->dbh->selectrow_array("SELECT NOW()"); - $params->{comment_count} = 0; - $params->{creation_ts} = $timestamp; + my $dbh = Bugzilla->dbh; + my ($timestamp) = $dbh->selectrow_array("SELECT NOW()"); + if ($dbh->bz_column_info($class->DB_TABLE, 'comment_count')) { + $params->{comment_count} = 0; + } + if ($dbh->bz_column_info($class->DB_TABLE, 'creation_ts')) { + $params->{creation_ts} = $timestamp; + } } elsif ($class->isa('Bugzilla::Attachment')) { if ($params->{ispatch} && !Bugzilla->user->first_patch_bug_id) { Bugzilla->user->first_patch_bug_id($params->{bug}->id); diff --git a/extensions/UserProfile/Extension.pm b/extensions/UserProfile/Extension.pm index 079f7a948..9171b942d 100644 --- a/extensions/UserProfile/Extension.pm +++ b/extensions/UserProfile/Extension.pm @@ -385,7 +385,9 @@ sub object_columns { my ($self, $args) = @_; my ($class, $columns) = @$args{qw(class columns)}; if ($class->isa('Bugzilla::User')) { - push(@$columns, qw(last_activity_ts last_statistics_ts)); + my $dbh = Bugzilla->dbh; + my @new_columns = qw(last_activity_ts last_statistics_ts); + push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns; } } |