Commit cba46b0d authored by Koosha Khajeh Moogahi's avatar Koosha Khajeh Moogahi Committed by Frédéric Buclin

Bug 778674: Throw an error in Product.get() if required params are not passed

r/a=LpSolit
parent 5f60d183
......@@ -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>
......
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