From 5bc1ea1d1f2ca40bad6d53444a3d93cf0c616135 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Thu, 8 Oct 2015 15:33:52 +1300 Subject: [PATCH] CRM-17075 further fix to handling entity reference in search form This represents another step towards the logic of standardised saving & handling in the query layer and letting the form layer interpret that to a form --- CRM/Contact/Form/Task/SaveSearch.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/Task/SaveSearch.php b/CRM/Contact/Form/Task/SaveSearch.php index cb3fd33f45..427520412f 100644 --- a/CRM/Contact/Form/Task/SaveSearch.php +++ b/CRM/Contact/Form/Task/SaveSearch.php @@ -180,7 +180,13 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task { //save the search $savedSearch = new CRM_Contact_BAO_SavedSearch(); $savedSearch->id = $this->_id; - $savedSearch->form_values = serialize($this->get('formValues')); + // Use the query parameters rather than the form values - these have already been assessed / converted + // with the extra knowledge that the form has. + // Note that we want to move towards a standardised way of saving the query that is not + // an exact match for the form requirements & task the form layer with converting backwards and forwards. + // Ideally per CRM-17075 we will use entity reference fields heavily in the form layer & convert to the + // sql operator syntax at the query layer. + $savedSearch->form_values = serialize($this->get('queryParams')); $savedSearch->mapping_id = $mappingId; $savedSearch->search_custom_id = $this->get('customSearchID'); $savedSearch->save(); -- 2.25.1