From: Tim Otten Date: Wed, 15 Jan 2014 23:58:24 +0000 (-0800) Subject: CRM-13889 - CRM_Core_BAO_Dashboard - Fix test failure. Report error better. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f583d89b52b10e981ecf6c1e97c2cdcb83cb0cd7;p=civicrm-core.git CRM-13889 - CRM_Core_BAO_Dashboard - Fix test failure. Report error better. Note: It looks like there was a merge error because some of the relevant code was badly duplicated. --- diff --git a/CRM/Core/BAO/Dashboard.php b/CRM/Core/BAO/Dashboard.php index 3e6f4b11c8..62e71391ba 100644 --- a/CRM/Core/BAO/Dashboard.php +++ b/CRM/Core/BAO/Dashboard.php @@ -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);