From 6f1190247830372d513b97da8a845a0fb1ae804c Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 4 Aug 2020 21:22:43 -0400 Subject: [PATCH] APIv4 - Fix potential PHP undefined index warning Ensures the array key '0' exists in the where clause before accessing it. --- Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php b/Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php index 7f16a88e69..4ae6096c50 100644 --- a/Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php +++ b/Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php @@ -60,7 +60,7 @@ trait ArrayQueryActionTrait { * @return bool */ private function evaluateFilters($row) { - $where = $this->getWhere(); + $where = array_values($this->getWhere()); $allConditions = in_array($where[0], ['AND', 'OR', 'NOT']) ? $where : ['AND', $where]; return $this->walkFilters($row, $allConditions); } -- 2.25.1