From: Tim Otten Date: Mon, 3 Jun 2013 02:41:12 +0000 (-0400) Subject: CRM_Core_DAO - Throw clearer error message about pseudoconstants X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c303b657acc6d8f88c0950ea9c958ff3db72aeca;p=civicrm-core.git CRM_Core_DAO - Throw clearer error message about pseudoconstants --- 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);