From 1726c7d255b49e5825c6eec275b9bb13a3fdcd3a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 3 Jul 2015 22:22:49 -0400 Subject: [PATCH] CRM-16643 - Deprecate 'setvalue' api action & switch editable default to 'create' --- CRM/Report/Form/Extended.php | 2 +- api/v3/utils.php | 4 ++-- js/jquery/jquery.crmeditable.js | 2 +- templates/CRM/common/enableDisableApi.tpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index 93b54e060c..95aefff3f5 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -1231,7 +1231,7 @@ WHERE line_item_civireport.id IS NOT NULL } $contactID = $row['civicrm_contact_id']; return "
- + " . $value . "
"; } diff --git a/api/v3/utils.php b/api/v3/utils.php index 71cde7a963..bb57d3aba0 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -263,8 +263,8 @@ 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') { + // Always report "setvalue" action as deprecated. + if (!is_string($deprecated) && ($action == 'getactions' || $action == 'setvalue')) { $deprecated = ((array) $deprecated) + array('setvalue' => 'The "setvalue" action is deprecated. Use "create" with an id instead.'); } // Always report "update" action as deprecated. diff --git a/js/jquery/jquery.crmeditable.js b/js/jquery/jquery.crmeditable.js index 6d42a91719..2b8a12f2e9 100644 --- a/js/jquery/jquery.crmeditable.js +++ b/js/jquery/jquery.crmeditable.js @@ -18,7 +18,7 @@ $row = this.first().closest('.crm-entity'); ret.entity = $row.data('entity') || $row[0].id.split('-')[0]; ret.id = $row.data('id') || $row[0].id.split('-')[1]; - ret.action = $row.data('action') || 'setvalue'; + ret.action = $row.data('action') || 'create'; if (!ret.entity || !ret.id) { return false; diff --git a/templates/CRM/common/enableDisableApi.tpl b/templates/CRM/common/enableDisableApi.tpl index 31b8236350..1b8131da0c 100644 --- a/templates/CRM/common/enableDisableApi.tpl +++ b/templates/CRM/common/enableDisableApi.tpl @@ -42,7 +42,7 @@ function save() { $row.closest('table').block(); - CRM.api3(info.entity, info.action, {id: info.id, field: 'is_active', value: enabled ? 0 : 1}, {success: successMsg}).done(refresh); + CRM.api3(info.entity, info.action, {id: info.id, is_active: enabled ? 0 : 1}, {success: successMsg}).done(refresh); } function checkResponse(e, response) { -- 2.25.1