From 1c2683cd80c5fb6ac7facb90c959e54eb8da9cfa Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 15 Jun 2020 18:20:14 -0400 Subject: [PATCH] Sort options without relying on unavailable buildOptions param --- CRM/Contact/BAO/Query.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 122c1ac3f8..8da84737d7 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -6409,9 +6409,8 @@ AND displayRelType.is_active = 1 if (empty($fieldSpec['bao'])) { continue; } - $sortedOptions = $fieldSpec['bao']::buildOptions($fieldSpec['name'], NULL, [ - 'orderColumn' => CRM_Utils_Array::value('labelColumn', $pseudoConstantMetadata, 'label'), - ]); + $sortedOptions = $fieldSpec['bao']::buildOptions($fieldSpec['name']); + natcasesort($sortedOptions); $fieldIDsInOrder = implode(',', array_keys($sortedOptions)); // Pretty sure this validation ALSO happens in the order clause & this can't be reached but... // this might give some early warning. -- 2.25.1