estimated_time
everconfirmed
lastdiffed
+ master_bug_id
op_sys
priority
product_id
everconfirmed => \&Bugzilla::Object::check_boolean,
groups => \&_check_groups,
keywords => \&_check_keywords,
+ master_bug_id => \&_check_master_bug_id,
op_sys => \&_check_select_field,
priority => \&_check_priority,
product => \&_check_product,
deadline
estimated_time
everconfirmed
+ master_bug_id
op_sys
priority
product_id
return [values %keywords];
}
+sub _check_master_bug_id {
+ my ($invocant, $bug_id) = @_;
+ my $bug = Bugzilla::Bug->check_for_edit({ id => $bug_id });
+
+ # Make sure the master bug isn't already a sighting.
+ if (defined $bug->master_bug_id) {
+ ThrowUserError("sighting_of_sighting_not_allowed");
+ }
+
+ return $bug->id;
+}
+
sub _check_product {
my ($invocant, $name) = @_;
$name = trim($name);
sub error { return $_[0]->{error} }
sub everconfirmed { return $_[0]->{everconfirmed} }
sub lastdiffed { return $_[0]->{lastdiffed} }
+sub master_bug_id { return $_[0]->{master_bug_id} }
sub op_sys { return $_[0]->{op_sys} }
sub priority { return $_[0]->{priority} }
sub product_id { return $_[0]->{product_id} }
return $self->{see_also};
}
+sub sightings {
+ my $self = shift;
+ return [] if $self->{'error'};
+ $self->{'sightings'} ||= Bugzilla::Bug->match({master_bug_id => $self->id});
+ return $self->{'sightings'};
+}
+
sub status {
my $self = shift;
return undef if $self->{'error'};
NOTNULL => 1, DEFAULT => '0'},
deadline => {TYPE => 'DATETIME'},
alias => {TYPE => 'varchar(20)'},
+ master_bug_id => {TYPE => 'INT3',
+ REFERENCES => {TABLE => 'bugs',
+ COLUMN => 'bug_id'}},
],
INDEXES => [
bugs_alias_idx => {FIELDS => ['alias'],
{name => 'see_also', desc => "See Also",
type => FIELD_TYPE_BUG_URLS},
{name => 'tag', desc => 'Tags'},
+ {name => 'master_bug_id', desc => 'Master Bug ID',
+ in_new_bugmail => 1, is_numeric => 1},
);
################
# 2011-06-15 dkl@mozilla.com - Bug 658929
_migrate_disabledtext_boolean();
+ # 2011-08-29 rowebb@gmail.com - Bug 679547
+ $dbh->bz_add_column('bugs', 'master_bug_id', {TYPE => 'INT3'});
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
id => $self->type('int', $bug->bug_id),
is_confirmed => $self->type('boolean', $bug->everconfirmed),
last_change_time => $self->type('dateTime', $bug->delta_ts),
+ master_bug_id => $self->type('int', $bug->master_bug_id),
op_sys => $self->type('string', $bug->op_sys),
platform => $self->type('string', $bug->rep_platform),
priority => $self->type('string', $bug->priority),
@{ $bug->see_also };
$item{'see_also'} = \@see_also;
}
+ if (filter_wants $params, 'sightings') {
+ my @sightings = map { $self->type('int', $_->id) } @{ $bug->sightings };
+ $item{'sightings'} = \@sightings;
+ }
# And now custom fields
my @custom_fields = Bugzilla->active_custom_fields;
C<dateTime> When the bug was last changed.
+=item C<master_bug_id>
+
+C<int> The unique numeric id of the master bug that this bug is a sighting of.
+C<undef> if this bug is not a sighting.
+
=item C<op_sys>
C<string> The name of the operating system that the bug was filed against.
C<string> The current severity of the bug.
+=item C<sightings>
+
+C<array> of C<int>s The numeric ids of all this bug's sightings.
+
=item C<status>
C<string> The current status of the bug.
C<target_milestone>, C<update_token>, C<url>, C<version>, C<whiteboard>,
and all custom fields.
+=item In Bugzilla B<5.0> C<sightings> and C<master_bug_id> were added to
+the C<bugs> return value.
+
=back
[%+ series.name FILTER html %]</em>
already exists.
+ [% ELSIF error == "sighting_of_sighting_not_allowed" %]
+ [% title = "Sightings of Sightings are Not Allowed" %]
+ You may not create a sighting of a sighting or make a master
+ [% terms.bug %] a sighting of another [% terms.bug %].
+
[% ELSIF error == "still_unresolved_bugs" %]
[% title = "Unresolved Dependencies" %]
[% IF bug_id %]