]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 778674: Throw an error in Product.get() if required params are not passed
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>
Tue, 31 Jul 2012 12:38:08 +0000 (14:38 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 31 Jul 2012 12:38:08 +0000 (14:38 +0200)
r/a=LpSolit

Bugzilla/WebService/Product.pm

index 136870890b9a90e84388908f9427d7211f51826a..18594d7260e77b00309504637d9656e426728664 100644 (file)
@@ -67,6 +67,9 @@ sub get_accessible_products {
 sub get {
     my ($self, $params) = validate(@_, 'ids', 'names');
 
+    defined $params->{ids} || defined $params->{names}
+        || ThrowCodeError("params_required", { function => "Product.get",
+                                               params => ['ids', 'names'] });
     Bugzilla->switch_to_shadow_db();
 
     # Only products that are in the users accessible products, 
@@ -363,7 +366,9 @@ B<EXPERIMENTAL>
 
 Returns a list of information about the products passed to it.
 
-Note: Can also be called as "get_products" for compatibilty with Bugzilla 3.0 API.
+B<Note>: You must at least specify one of C<ids> or C<names>.
+
+B<Note>: Can also be called as "get_products" for compatibilty with Bugzilla 3.0 API.
 
 =item B<Params>