Commit 6db7045a authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 302650: Product.pm methods don't return what is expected for milestones and…

Bug 302650: Product.pm methods don't return what is expected for milestones and versions - Patch by Gabriel Sales de Oliveira <gabriel@async.com.br> r=LpSolit a=justdave
parent 630116a9
...@@ -101,7 +101,7 @@ sub components { ...@@ -101,7 +101,7 @@ sub components {
$self->{components} = $self->{components} =
Bugzilla::Component::get_components_by_product($self->id); Bugzilla::Component::get_components_by_product($self->id);
} }
return $self->{components} return $self->{components};
} }
sub classification { sub classification {
...@@ -128,9 +128,9 @@ sub versions { ...@@ -128,9 +128,9 @@ sub versions {
my $self = shift; my $self = shift;
if (!defined $self->{versions}) { if (!defined $self->{versions}) {
$self->{versions} = my @versions =
Bugzilla::Version::get_versions_by_product($self->id); Bugzilla::Version::get_versions_by_product($self->id);
$self->{versions} = \@versions;
} }
return $self->{versions}; return $self->{versions};
} }
...@@ -139,8 +139,9 @@ sub milestones { ...@@ -139,8 +139,9 @@ sub milestones {
my $self = shift; my $self = shift;
if (!defined $self->{milestones}) { if (!defined $self->{milestones}) {
$self->{milestones} = my @milestones =
Bugzilla::Milestone::get_milestones_by_product($self->id); Bugzilla::Milestone::get_milestones_by_product($self->id);
$self->{milestones} = \@milestones;
} }
return $self->{milestones}; return $self->{milestones};
} }
...@@ -249,8 +250,8 @@ Bugzilla::Product - Bugzilla product class. ...@@ -249,8 +250,8 @@ Bugzilla::Product - Bugzilla product class.
my $components = $product->components(); my $components = $product->components();
my $classification = $product->classification(); my $classification = $product->classification();
my $hash_ref = $product->group_controls(); my $hash_ref = $product->group_controls();
my $hash_ref = $product->milestones(); my @array_ref = $product->milestones();
my $hash_ref = $product->versions(); my @array_ref = $product->versions();
my $bugcount = $product->bug_count(); my $bugcount = $product->bug_count();
my $id = $product->id; my $id = $product->id;
...@@ -317,21 +318,19 @@ Product.pm represents a product object. ...@@ -317,21 +318,19 @@ Product.pm represents a product object.
=item C<versions()> =item C<versions()>
Description: Returns a hash with of all product versions. Description: Returns all valid versions for that product.
Params: none. Params: none.
Returns: A hash with version id as key and a Bugzilla::Version Returns: An array of Bugzilla::Version objects.
as value.
=item C<milestones()> =item C<milestones()>
Description: Returns a hash with of all product milestones. Description: Returns all valid milestones for that product.
Params: none. Params: none.
Returns: A hash with milestone id as key and a Bugzilla::Milestone Returns: An array of Bugzilla::Milestone objects.
as value.
=item C<bug_count()> =item C<bug_count()>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment