From: Coleman Watts Date: Fri, 3 Jul 2015 20:40:59 +0000 (-0400) Subject: CRM-16643 - Add 'setvalue' deprecation warning to api explorer X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=265df5a067aa16d2f5a89d1d0c073ea67b18030e;p=civicrm-core.git CRM-16643 - Add 'setvalue' deprecation warning to api explorer --- 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.');