From 9b576df4d662d4aef4f25dfbd97590ec31f8caee Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 19 Oct 2014 23:58:28 +1300 Subject: [PATCH] SyntaxConformanceTest fix tag to work on singlevaluealter --- CRM/Core/BAO/Tag.php | 7 ++++--- tests/phpunit/api/v3/SyntaxConformanceTest.php | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index 1b8e840aa2..63378fc4cd 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -314,7 +314,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @static */ static function add(&$params, $ids = array()) { - if (!self::dataExists($params)) { + $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('tag', $ids)); + if (!$id && !self::dataExists($params)) { return NULL; } @@ -327,8 +328,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { } $tag->copyValues($params); - $tag->id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('tag', $ids)); - $hook = empty($params['id']) ? 'create' : 'edit'; + $tag->id = $id; + $hook = !$id ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'Tag', $tag->id, $params); // save creator id and time diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 0c13c37cfe..c4611214a2 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -312,7 +312,6 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { 'Profile', 'CustomValue', 'SurveyRespondant', - 'Tag', 'UFMatch', 'UFJoin', 'UFField', -- 2.25.1