From 35a07880ea298332bffd078d298561a0ce700c67 Mon Sep 17 00:00:00 2001 From: Johan Vervloet Date: Fri, 23 Oct 2015 21:50:05 +0200 Subject: [PATCH] CRM-17430 - Hacky solution. ---------------------------------------- * 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/v3/Domain.php b/api/v3/Domain.php index 4dfcbd2265..0d6cb52bf8 100644 --- a/api/v3/Domain.php +++ b/api/v3/Domain.php @@ -130,6 +130,14 @@ function _civicrm_api3_domain_get_spec(&$params) { */ function civicrm_api3_domain_create($params) { $params['version'] = $params['domain_version']; + if ($params['version'] == 3) { + // This is an ugly hack to fix CRM-17430. Since CiviCRM version 3 is way + // older than this hack, we can safely assume that the user does not want + // to set his CiviCRM version to 3. + // domain_version is set to 3 by the function below. But if you leave that + // assignment out, a lot of unit tests break. So let's hack around this. + unset($params['version']); + } return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); } -- 2.25.1