Skip to content

Commit

Permalink
Make savedSearch bao sane
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Feb 17, 2020
1 parent 435a9dc commit bb50213
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
13 changes: 2 additions & 11 deletions CRM/Contact/BAO/SavedSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,19 +336,10 @@ public static function getName($id, $value = 'name') {
*/
public static function create(&$params) {
$savedSearch = new CRM_Contact_DAO_SavedSearch();
if (isset($params['formValues']) &&
!empty($params['formValues'])
) {
$savedSearch->copyValues($params);
if (!empty($params['formValues'])) {
$savedSearch->form_values = serialize($params['formValues']);
}
else {
$savedSearch->form_values = NULL;
}

$savedSearch->is_active = CRM_Utils_Array::value('is_active', $params, 1);
$savedSearch->mapping_id = CRM_Utils_Array::value('mapping_id', $params, 'null');
$savedSearch->custom_search_id = CRM_Utils_Array::value('custom_search_id', $params, 'null');
$savedSearch->id = CRM_Utils_Array::value('id', $params, NULL);

$savedSearch->save();

Expand Down
10 changes: 0 additions & 10 deletions tests/phpunit/api/v3/SyntaxConformanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public function setUp() {
'Payment',
'Order',
//work fine in local
'SavedSearch',
'Logging',
];
$this->toBeImplemented['delete'] = [
Expand Down Expand Up @@ -724,15 +723,6 @@ public function getKnownUnworkablesUpdateSingle($entity, $key) {
// View mode is part of the navigation which is not retrieved by the api.
'cant_return' => ['view_mode'],
],
'SavedSearch' => [
// I think the fields below are generated based on form_values.
'cant_update' => [
'search_custom_id',
'where_clause',
'select_tables',
'where_tables',
],
],
'StatusPreference' => [
'break_return' => [
'ignore_severity',
Expand Down

0 comments on commit bb50213

Please sign in to comment.