From 8ca34b1f49ee9c1633e87951bf50db668eff32e4 Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 13 Sep 2023 12:48:59 -0400 Subject: [PATCH] SearchKit - Fix invalid orderBy params --- ext/search_kit/Civi/Search/Admin.php | 2 +- .../tests/phpunit/api/v4/SearchDisplay/SearchRunTest.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/search_kit/Civi/Search/Admin.php b/ext/search_kit/Civi/Search/Admin.php index bcce70ae5b..8232f25233 100644 --- a/ext/search_kit/Civi/Search/Admin.php +++ b/ext/search_kit/Civi/Search/Admin.php @@ -150,7 +150,7 @@ class Admin { $getFields = civicrm_api4($entity['name'], 'getFields', [ 'select' => ['name', 'title', 'label', 'description', 'type', 'options', 'input_type', 'input_attrs', 'data_type', 'serialize', 'entity', 'fk_entity', 'readonly', 'operators', 'suffixes', 'nullable'], 'where' => [['deprecated', '=', FALSE], ['name', 'NOT IN', ['api_key', 'hash']]], - 'orderBy' => ['label'], + 'orderBy' => ['label' => 'ASC'], ])->indexBy('name'); } catch (\CRM_Core_Exception $e) { diff --git a/ext/search_kit/tests/phpunit/api/v4/SearchDisplay/SearchRunTest.php b/ext/search_kit/tests/phpunit/api/v4/SearchDisplay/SearchRunTest.php index 12593ce23a..e96b79ef3a 100644 --- a/ext/search_kit/tests/phpunit/api/v4/SearchDisplay/SearchRunTest.php +++ b/ext/search_kit/tests/phpunit/api/v4/SearchDisplay/SearchRunTest.php @@ -1016,7 +1016,6 @@ class SearchRunTest extends Api4TestBase implements TransactionalInterface { "GROUP_CONCAT(DISTINCT subject) AS GROUP_CONCAT_subject", ], 'groupBy' => ['activity_type_id'], - 'orderBy' => ['activity_type_id:label'], 'where' => [], ], ], -- 2.25.1