From 265df5a067aa16d2f5a89d1d0c073ea67b18030e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 3 Jul 2015 16:40:59 -0400 Subject: [PATCH] CRM-16643 - Add 'setvalue' deprecation warning to api explorer --- api/v3/examples/Contact/GetActions.php | 1 + api/v3/utils.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/api/v3/examples/Contact/GetActions.php b/api/v3/examples/Contact/GetActions.php index f12c3fac94..12012f6949 100644 --- a/api/v3/examples/Contact/GetActions.php +++ b/api/v3/examples/Contact/GetActions.php @@ -67,6 +67,7 @@ function contact_getactions_expectedresult() { ), 'deprecated' => array( 'getquick' => 'The "getquick" action is deprecated in favor of "getlist".', + 'setvalue' => 'The "setvalue" action is deprecated. Use "create" with an id instead.', 'update' => 'The "update" action is deprecated. Use "create" with an id instead.', ), ); diff --git a/api/v3/utils.php b/api/v3/utils.php index 4aa999795d..cab2d4cc31 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -263,6 +263,10 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N } // Report deprecations. $deprecated = _civicrm_api3_deprecation_check($entity, $result); + // The "setvalue" action is deprecated but still in use, so report it only on "getactions". + if (!is_string($deprecated) && $action == 'getactions') { + $deprecated = ((array) $deprecated) + array('setvalue' => 'The "setvalue" action is deprecated. Use "create" with an id instead.'); + } // Always report "update" action as deprecated. if (!is_string($deprecated) && ($action == 'getactions' || $action == 'update')) { $deprecated = ((array) $deprecated) + array('update' => 'The "update" action is deprecated. Use "create" with an id instead.'); -- 2.25.1