ManagedEntities e-notice fix - as exposed by test getsingle will not have an 'is_erro...
authorEileen <eileen@fuzion.co.nz>
Fri, 3 Jan 2014 05:51:41 +0000 (18:51 +1300)
committerEileen <eileen@fuzion.co.nz>
Fri, 3 Jan 2014 05:51:41 +0000 (18:51 +1300)
CRM/Core/ManagedEntities.php
tests/phpunit/CRM/Core/ManagedEntitiesTest.php

index 1c0c5655552f911e74767e0d716a59b4bd47fc0b..bd053f6e301d9610887fc74562970c6949789237 100644 (file)
@@ -50,15 +50,15 @@ class CRM_Core_ManagedEntities {
     $dao->name = $name;
     if ($dao->find(TRUE)) {
       $params = array(
-        'version' => 3,
         'id' => $dao->entity_id,
       );
-      $result = civicrm_api($dao->entity_type, 'getsingle', $params);
-      if ($result['is_error']) {
+      try {
+        $result = civicrm_api3($dao->entity_type, 'getsingle', $params);
+      }
+      catch (Exception $e) {
         $this->onApiError($params, $result);
-      } else {
-        return $result;
       }
+      return $result;
     } else {
       return NULL;
     }
index ff7b704e48b01ee40d05cd59d472642e313391d4..bd0b99795381e29d3f0bd8f7ca3356bf00e73aab 100644 (file)
@@ -3,10 +3,6 @@
 require_once 'CiviTest/CiviUnitTestCase.php';
 
 class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase {
-  //@todo make BAO enotice compliant  & remove the line below
-  // WARNING - NEVER COPY & PASTE $_eNoticeCompliant = FALSE
-  // new test classes should be compliant.
-  public $_eNoticeCompliant = FALSE;
   function get_info() {
     return array(
       'name'    => 'ManagedEntities',