From 81fc16775d565d3c01b2924630942b4936c353d0 Mon Sep 17 00:00:00 2001 From: Eileen Date: Fri, 3 Jan 2014 19:54:08 +1300 Subject: [PATCH] fix e-Notice on deprecated utils --- CRM/Utils/DeprecatedUtils.php | 3 +++ tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index fd7790a193..f3502ae60b 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -1341,6 +1341,9 @@ function _civicrm_api3_deprecated_contact_check_params( // contact_type has a limited number of valid values + if(empty($params['contact_type'])) { + return civicrm_api3_create_error("No Contact Type"); + } $fields = CRM_Utils_Array::value($params['contact_type'], $required); if ($fields == NULL) { return civicrm_api3_create_error("Invalid Contact Type: {$params['contact_type']}"); diff --git a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php index 6f0e6a631e..fd84c662b3 100644 --- a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php +++ b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php @@ -4,10 +4,6 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CRM/Utils/DeprecatedUtils.php'; class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase { - //@todo make BAO enotice compliant & remove the line below - // WARNING - NEVER COPY & PASTE $_eNoticeCompliant = FALSE - // new test classes should be compliant. - public $_eNoticeCompliant = FALSE; function get_info() { return array( -- 2.25.1