From f2ed6607198e2137aca1fd44422f60334d3a7d7b Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 4 Oct 2023 10:53:12 -0400 Subject: [PATCH] SearchKit - Use filters from having clause as well as where clause for toolbar buttons --- ext/search_kit/Civi/Api4/Action/SearchDisplay/Run.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/search_kit/Civi/Api4/Action/SearchDisplay/Run.php b/ext/search_kit/Civi/Api4/Action/SearchDisplay/Run.php index 79c5f7f416..acf179ed1d 100644 --- a/ext/search_kit/Civi/Api4/Action/SearchDisplay/Run.php +++ b/ext/search_kit/Civi/Api4/Action/SearchDisplay/Run.php @@ -137,8 +137,8 @@ class Run extends AbstractRunAction { return []; } // There is no row data, but some values can be inferred from query filters - // First pass: gather raw data from the where clause - foreach ($this->_apiParams['where'] as $clause) { + // First pass: gather raw data from the where & having clauses + foreach (array_merge($this->_apiParams['where'], $this->_apiParams['having'] ?? []) as $clause) { if ($clause[1] === '=' || $clause[1] === 'IN') { $data[$clause[0]] = $clause[2]; } -- 2.25.1