CRM-13889 - CRM_Core_BAO_Dashboard - Fix test failure. Report error better.
authorTim Otten <totten@civicrm.org>
Wed, 15 Jan 2014 23:58:24 +0000 (15:58 -0800)
committerTim Otten <totten@civicrm.org>
Wed, 15 Jan 2014 23:58:24 +0000 (15:58 -0800)
Note: It looks like there was a merge error because some of the relevant
code was badly duplicated.

CRM/Core/BAO/Dashboard.php

index 3e6f4b11c849c9f453442158bba784b9f8d8450a..62e71391baa101100ac81e453aadf3d00e5549cf 100644 (file)
@@ -308,8 +308,9 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
       $contactID = $session->get('userID');
     }
 
-    $session = CRM_Core_Session::singleton();
-    $contactID = $session->get('userID');
+    if (empty($contactID)) {
+      throw new RuntimeException("Failed to determine contact ID");
+    }
 
     //we need to get existing dashletes, so we know when to update or insert
     $contactDashlets = self::getContactDashlets(TRUE, $contactID);