Enable api_v3_syntaxConformaceTest::testInvalidID_delete (#9068)
[civicrm-core.git] / api / v3 / Dashboard.php
index 95a7327fd38255bdcb404b6589199800cab794cf..77f6d30bd6141e0d46e3c67f2b858f32f1101fa3 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -61,6 +61,7 @@ function civicrm_api3_dashboard_create($params) {
  *   array of parameters determined by getfields.
  */
 function _civicrm_api3_dashboard_create_spec(&$params) {
+  $params['is_active']['api.default'] = 1;
   unset($params['version']);
 }
 
@@ -92,6 +93,6 @@ function civicrm_api3_dashboard_delete($params) {
     return civicrm_api3_create_success(1, $params, 'Dashboard', 'delete');
   }
   else {
-    return civicrm_api3_create_error('Could not delete dashlet');
+    throw new API_Exception('Could not delete dashlet');
   }
 }