From e0c10f3564cec8a584d6ba4d45100b046614ba2f Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 7 Sep 2021 15:45:27 +0300 Subject: [PATCH] fix --- application/Espo/Core/Select/SelectManager.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/Espo/Core/Select/SelectManager.php b/application/Espo/Core/Select/SelectManager.php index 8b2d9867cd..7060527d9d 100644 --- a/application/Espo/Core/Select/SelectManager.php +++ b/application/Espo/Core/Select/SelectManager.php @@ -2163,11 +2163,13 @@ class SelectManager */ public function hasJoin($join, array &$result) { - if (in_array($join, $result['joins'])) { + $list = $result['joins'] ?? []; + + if (in_array($join, $list)) { return true; } - foreach ($result['joins'] as $item) { + foreach ($list as $item) { if (is_array($item) && count($item) > 1) { if ($item[1] == $join) { return true; @@ -2184,11 +2186,13 @@ class SelectManager */ public function hasLeftJoin($leftJoin, array &$result) { - if (in_array($leftJoin, $result['leftJoins'])) { + $list = $result['leftJoins'] ?? []; + + if (in_array($leftJoin, $list)) { return true; } - foreach ($result['leftJoins'] as $item) { + foreach ($list as $item) { if (is_array($item) && count($item) > 1) { if ($item[1] == $leftJoin) { return true;