From: colemanw Date: Wed, 13 Sep 2023 16:48:59 +0000 (-0400) Subject: SearchKit - Fix invalid orderBy params X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8ca34b1f49ee9c1633e87951bf50db668eff32e4;p=civicrm-core.git SearchKit - Fix invalid orderBy params --- 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' => [], ], ],