CRM_Case_BAO_Case - Every call to Error::ignoreException should have matching call...
authorTim Otten <totten@civicrm.org>
Fri, 13 Sep 2013 23:11:40 +0000 (16:11 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 13 Sep 2013 23:11:40 +0000 (16:11 -0700)
CRM/Case/BAO/Case.php

index d844b81c058df50564b10d277714ff72c68f19fe..27b3324a8fb3012f04b620744e9df99b6aa01569 100644 (file)
@@ -3095,17 +3095,20 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
    * Used during case component enablement and during ugprade
    */
   static function createCaseViews() {
+    $dao = new CRM_Core_DAO();
+
     $sql = self::createCaseViewsQuery('upcoming');
     CRM_Core_Error::ignoreException();
-    $dao = new CRM_Core_DAO();
     $dao->query($sql);
+    CRM_Core_Error::setCallback();
     if (PEAR::getStaticProperty('DB_DataObject', 'lastError')) {
-      CRM_Core_Error::setCallback();
       return FALSE;
     }
 
     // Above error doesn't get caught?
+    CRM_Core_Error::ignoreException();
     $doublecheck = $dao->singleValueQuery("SELECT count(id) FROM civicrm_view_case_activity_upcoming");
+    CRM_Core_Error::setCallback();
     if (is_null($doublecheck)) {
       return FALSE;
     }
@@ -3113,13 +3116,15 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
     $sql = self::createCaseViewsQuery('recent');
     CRM_Core_Error::ignoreException();
     $dao->query($sql);
+    CRM_Core_Error::setCallback();
     if (PEAR::getStaticProperty('DB_DataObject', 'lastError')) {
-      CRM_Core_Error::setCallback();
       return FALSE;
     }
 
     // Above error doesn't get caught?
+    CRM_Core_Error::ignoreException();
     $doublecheck = $dao->singleValueQuery("SELECT count(id) FROM civicrm_view_case_activity_recent");
+    CRM_Core_Error::setCallback();
     if (is_null($doublecheck)) {
       return FALSE;
     }