Merge pull request #456 from colemanw/help
[civicrm-core.git] / api / v3 / Case.php
index 7e465b482d9da9900501232b96fcb314fb325d5a..5f6d4d0debb768c71a35bbdb3224f128fdfe8f92 100644 (file)
@@ -187,6 +187,10 @@ function _civicrm_api3_case_delete_spec(&$params) {
  * @todo Erik Hommel 16 dec 2010 check if all DB fields are returned
  */
 function civicrm_api3_case_get($params) {
+  civicrm_api3_verify_mandatory($params, NULL, array(
+    array('case_id', 'contact_id', 'activity_id', 'contact_id')
+  ));
+
   $options = _civicrm_api3_get_options_from_params($params);
 
   // Get by id
@@ -258,8 +262,6 @@ SELECT DISTINCT case_id
     }
     return civicrm_api3_create_success($cases, $params, 'case', 'get');
   }
-
-  return civicrm_api3_create_error('Missing required parameter. Must provide case_id, contact_id, activity_id, or contact_id.');
 }
 
 /**