]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 783866: Add support to call Bugzilla::Milestone->check({ id => $id })
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>
Tue, 4 Sep 2012 17:15:21 +0000 (19:15 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 4 Sep 2012 17:15:21 +0000 (19:15 +0200)
r/a=LpSolit

Bugzilla/Milestone.pm

index 8f243232da11142545b60d9e0505ef566df37586..f66e1d3c706cb417e5635d4cdcdc834d3b2a1879 100644 (file)
@@ -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.