diff options
author | Koosha Khajeh Moogahi <koosha.khajeh@gmail.com> | 2012-09-04 19:15:21 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-09-04 19:15:21 +0200 |
commit | 21fde55ccb6c2e4237f93f1c9f481a85f414e39e (patch) | |
tree | 1571f0c61b5797441c3801672b3532c931d3459d /Bugzilla/Milestone.pm | |
parent | c3d86302f155ca9467d4fe80942ec91e6dd9e812 (diff) | |
download | bugs-21fde55ccb6c2e4237f93f1c9f481a85f414e39e.tar bugs-21fde55ccb6c2e4237f93f1c9f481a85f414e39e.tar.gz bugs-21fde55ccb6c2e4237f93f1c9f481a85f414e39e.tar.bz2 bugs-21fde55ccb6c2e4237f93f1c9f481a85f414e39e.tar.xz bugs-21fde55ccb6c2e4237f93f1c9f481a85f414e39e.zip |
Bug 783866: Add support to call Bugzilla::Milestone->check({ id => $id })
r/a=LpSolit
Diffstat (limited to 'Bugzilla/Milestone.pm')
-rw-r--r-- | Bugzilla/Milestone.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Bugzilla/Milestone.pm b/Bugzilla/Milestone.pm index 8f243232d..f66e1d3c7 100644 --- a/Bugzilla/Milestone.pm +++ b/Bugzilla/Milestone.pm @@ -65,7 +65,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) { @@ -242,7 +242,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; @@ -266,7 +268,7 @@ Milestone.pm represents a Product Milestone object. =over -=item C<new({name => $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. @@ -356,7 +358,7 @@ Milestone.pm represents a Product Milestone object. =over -=item C<create({value => $value, product => $product, sortkey => $sortkey})> +=item C<< create({value => $value, product => $product, sortkey => $sortkey}) >> Description: Create a new milestone for the given product. |