From 1a062f4ebf162ed403d67971c9e7422b3cdc1802 Mon Sep 17 00:00:00 2001 From: Koosha Khajeh Moogahi Date: Tue, 4 Sep 2012 19:16:45 +0200 Subject: [PATCH] Bug 783866: Add support to call Bugzilla::Milestone->check({ id => $id }) r/a=LpSolit --- Bugzilla/Milestone.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Milestone.pm b/Bugzilla/Milestone.pm index ef8ecbab57..caa4afcdd4 100644 --- a/Bugzilla/Milestone.pm +++ b/Bugzilla/Milestone.pm @@ -64,7 +64,7 @@ sub new { my $dbh = Bugzilla->dbh; my $product; - if (ref $param) { + if (ref $param and !defined $param->{id}) { $product = $param->{product}; my $name = $param->{name}; if (!defined $product) { @@ -241,7 +241,9 @@ Bugzilla::Milestone - Bugzilla product milestone class. use Bugzilla::Milestone; - my $milestone = new Bugzilla::Milestone({ name => $name, product => $product }); + my $milestone = new Bugzilla::Milestone({ name => $name, product => $product_obj }); + my $milestone = Bugzilla::Milestone->check({ name => $name, product => $product_obj }); + my $milestone = Bugzilla::Milestone->check({ id => $id }); my $name = $milestone->name; my $product_id = $milestone->product_id; @@ -265,7 +267,7 @@ Milestone.pm represents a Product Milestone object. =over -=item C $name, product => $product})> +=item C<< new({name => $name, product => $product}) >> Description: The constructor is used to load an existing milestone by passing a product object and a milestone name. @@ -355,7 +357,7 @@ Milestone.pm represents a Product Milestone object. =over -=item C $value, product => $product, sortkey => $sortkey})> +=item C<< create({value => $value, product => $product, sortkey => $sortkey}) >> Description: Create a new milestone for the given product. -- 2.47.2