Skip to content

Commit

Permalink
Fix "no such field" failure in SmartGroup upgrade
Browse files Browse the repository at this point in the history
Calling api get with no return fields specified is always risky during upgrades because upgrades can add/drop columns.
  • Loading branch information
colemanw committed Mar 2, 2020
1 parent 772f7c6 commit eee8efb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CRM/Upgrade/Incremental/SmartGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,11 @@ public function renameFields($pairs) {
* @return mixed
*/
protected function getSearchesWithField($field) {
$savedSearches = civicrm_api3('SavedSearch', 'get', [
return civicrm_api3('SavedSearch', 'get', [
'options' => ['limit' => 0],
'form_values' => ['LIKE' => "%{$field}%"],
'return' => ['id', 'form_values'],
])['values'];
return $savedSearches;

}

/**
Expand Down

0 comments on commit eee8efb

Please sign in to comment.