Skip to content

Commit

Permalink
Merge pull request #15454 from demeritcowboy/custom-fieldspec-bao
Browse files Browse the repository at this point in the history
dev/core#1305 - fieldspec bao not defined for custom fields
  • Loading branch information
seamuslee001 authored Oct 8, 2019
2 parents b4c078b + 1dd6ae6 commit 0194707
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -6419,6 +6419,10 @@ protected function prepareOrderBy($sort, $sortOrder) {
if (!empty($pseudoConstantMetadata['optionGroupName'])
|| $this->isPseudoFieldAnFK($fieldSpec)
) {
// dev/core#1305 @todo this is not the right thing to do but for now avoid fatal error
if (empty($fieldSpec['bao'])) {
continue;
}
$sortedOptions = $fieldSpec['bao']::buildOptions($fieldSpec['name'], NULL, [
'orderColumn' => CRM_Utils_Array::value('labelColumn', $pseudoConstantMetadata, 'label'),
]);
Expand Down

0 comments on commit 0194707

Please sign in to comment.