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 authored and eileenmcnaughton committed Mar 4, 2020
1 parent 4efbd5d commit 4de4307
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 4de4307

Please sign in to comment.