From 37a77d9c27fc7d9af250b90a8721e252ceb78f15 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 2 Aug 2013 16:20:54 -0700 Subject: [PATCH] CRM_Core_BAO_Block - Fix API regressions --- CRM/Core/BAO/Block.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index bf88799764..47b287af11 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -434,8 +434,10 @@ class CRM_Core_BAO_Block { * @static */ public static function handlePrimary(&$params, $class) { - $coreTables = CRM_Core_DAO_AllCoreTables::getCoreTables(); - $table = array_search($class, $coreTables); + $table = CRM_Core_DAO_AllCoreTables::getTableForClass($class); + if (!$table) { + throw new API_Exception("Failed to locate table for class [$class]"); + } // contact_id in params might be empty or the string 'null' so cast to integer $contactId = (int) CRM_Utils_Array::value('contact_id', $params); -- 2.25.1