From 53804fc55da225c8b07f968e38be42c2812485bb Mon Sep 17 00:00:00 2001 From: DemeritCowboy Date: Tue, 8 Oct 2019 13:04:26 -0400 Subject: [PATCH] dev/core#1305 --- CRM/Contact/BAO/Query.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 9d5e64a38a51..56acef4c3670 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -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'), ]);