//save the search
$savedSearch = new CRM_Contact_BAO_SavedSearch();
$savedSearch->id = $this->_id;
+ $queryParams = $this->get('queryParams');
+ // CRM-18585 include selected operator in $savedSearch->form_values
+ if (!empty($formValues['operator'])) {
+ $queryParams[] = array('operator', '=', $formValues['operator'], 0, 0);
+ }
// 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
// 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.
if (!$isSearchBuilder) {
- $savedSearch->form_values = serialize($this->get('queryParams'));
+ $savedSearch->form_values = serialize($queryParams);
}
else {
// We want search builder to be able to convert back & forth at the form layer