From 73156a79aa0c1f4ec16759606caeefc355d2b403 Mon Sep 17 00:00:00 2001 From: Johan Vervloet Date: Fri, 23 Oct 2015 22:18:31 +0200 Subject: [PATCH] CRM-17430 - domain_version instead of version in Domain result. ---------------------------------------- * CRM-17430: Altering the domain using the API changes the CiviCRM version to 3 https://issues.civicrm.org/jira/browse/CRM-17430 --- api/v3/Domain.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api/v3/Domain.php b/api/v3/Domain.php index 2d2baf69ed..f72befdd45 100644 --- a/api/v3/Domain.php +++ b/api/v3/Domain.php @@ -99,6 +99,10 @@ function civicrm_api3_domain_get($params) { list($domain['from_name'], $domain['from_email'] ) = CRM_Core_BAO_Domain::getNameAndEmail(TRUE); + + // Rename version to domain_version, see CRM-17430. + $domain['domain_version'] = $domain['version']; + unset($domain['version']); $domains[$domain['id']] = array_merge($domains[$domain['id']], $domain); } } @@ -135,7 +139,13 @@ function civicrm_api3_domain_create($params) { else { unset($params['version']); } - return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); + $result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); + + // Rename version to domain_version, see CRM-17430. + $result_value = CRM_Utils_Array::first($result['values']); + $result_value['domain_version'] = $result_value['version']; + unset($result_value['version']); + return $result; } /** -- 2.25.1