From c303b657acc6d8f88c0950ea9c958ff3db72aeca Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 2 Jun 2013 22:41:12 -0400 Subject: [PATCH] CRM_Core_DAO - Throw clearer error message about pseudoconstants --- CRM/Core/DAO.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index ecf28df3fc..f37b8d3e16 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1325,6 +1325,9 @@ SELECT contact_id } $constant = CRM_Utils_Array::value('pseudoconstant', $value); if (!empty($constant)) { + if (empty($constant['name'])) { + throw new CRM_Core_Exception("Failed to choose value for $daoName ($name) -- missing pseudo-constant name"); + } $constantValues = CRM_Utils_PseudoConstant::getConstant($constant['name']); if (!empty($constantValues)) { $constantOptions = array_keys($constantValues); -- 2.25.1