From 24d5a341faaae054baef3334cfd7745029d6d1e9 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 4 Feb 2019 17:39:41 +1300 Subject: [PATCH 1/2] Revert "Rewrite testHiddenSmartGroup" This reverts commit 7810fa53a7f5d8be82ebda7fde122d0fd349d358. --- tests/phpunit/CRM/Contact/BAO/GroupTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/phpunit/CRM/Contact/BAO/GroupTest.php b/tests/phpunit/CRM/Contact/BAO/GroupTest.php index dfcc8c9630e6..481e9bca1a4f 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupTest.php @@ -252,11 +252,9 @@ public function testHiddenSmartGroup() { $contactID = $this->individualCreate(['custom_' . $customFieldID => 'abc']); - $formValues = ['custom_' . $customFieldID => ['LIKE' => '%a%']]; - $hiddenSmartParams = [ 'group_type' => ['2' => 1], - 'form_values' => CRM_Contact_BAO_Query::convertFormValues($formValues), + 'form_values' => ['custom_' . $customFieldID => ['LIKE' => '%a%']], 'saved_search_id' => NULL, 'search_custom_id' => NULL, 'search_context' => 'advanced', From 8706194029d3e05c9b523847b92032bd9dade58b Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 4 Feb 2019 18:03:49 +1300 Subject: [PATCH 2/2] Revert "Assign the translated formValues to itself" This reverts commit e8ef090642f0ff5639166b847a31f4e50eec3dd6. --- CRM/Contact/BAO/Group.php | 2 +- CRM/Contact/Form/Search/Advanced.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 00dead650a12..2c40bcec5cd4 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -695,7 +695,7 @@ public static function createHiddenSmartGroup($params) { //create/update saved search record. $savedSearch = new CRM_Contact_BAO_SavedSearch(); $savedSearch->id = $ssId; - $savedSearch->form_values = serialize($params['form_values']); + $savedSearch->form_values = serialize(CRM_Contact_BAO_Query::convertFormValues($params['form_values'])); $savedSearch->mapping_id = $mappingId; $savedSearch->search_custom_id = CRM_Utils_Array::value('search_custom_id', $params); $savedSearch->save(); diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 35cec89cf20c..6c40a36ed7a4 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -314,7 +314,7 @@ public function postProcess() { CRM_Core_BAO_CustomValue::fixCustomFieldValue($this->_formValues); - $this->_formValues = $this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields); + $this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, $this->entityReferenceFields); $this->_returnProperties = &$this->returnProperties(); parent::postProcess(); }