From 26ab4dbe349972378768251e99a9621728606fbb Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 6 Sep 2023 16:42:48 -0400 Subject: [PATCH] SearchKit - Don't crash afforms with non-dao entities --- ext/search_kit/Civi/Search/Meta.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/search_kit/Civi/Search/Meta.php b/ext/search_kit/Civi/Search/Meta.php index 40251f5010..9fadf2364c 100644 --- a/ext/search_kit/Civi/Search/Meta.php +++ b/ext/search_kit/Civi/Search/Meta.php @@ -29,8 +29,11 @@ class Meta { * @return array */ public static function getCalcFields($apiEntity, $apiParams): array { - $calcFields = []; $api = \Civi\API\Request::create($apiEntity, 'get', $apiParams); + if (!is_a($api, '\Civi\Api4\Generic\DAOGetAction')) { + return []; + } + $calcFields = []; $selectQuery = new \Civi\Api4\Query\Api4SelectQuery($api); $joinMap = $joinCount = []; foreach ($apiParams['join'] ?? [] as $join) { -- 2.25.1