From 282d47aed4860f6425a119c85d4daab49296f3a3 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 16 Nov 2022 13:51:38 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B05727=20-=20REST=20API/get=5Frelated:=20S?= =?UTF-8?q?eemingly=20wrong=20results,=20when=20using=20[impacts,=20up]=20?= =?UTF-8?q?with=20[redundancy:=20true]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobjectset.class.php | 3 ++- core/dbsearch.class.php | 2 +- core/restservices.class.inc.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/dbobjectset.class.php b/core/dbobjectset.class.php index 57c2da786..6e70cbc3b 100644 --- a/core/dbobjectset.class.php +++ b/core/dbobjectset.class.php @@ -141,7 +141,7 @@ class DBObjectSet implements iDBObjectSetIterator { $sRet = ''; $this->Rewind(); - $sRet .= "Set (".$this->m_oFilter->ToOQL().")
\n"; + $sRet .= "Set (".$this->m_oFilter->ToOQL(true).")
\n"; $sRet .= "Query:
".$this->m_oFilter->MakeSelectQuery().")
\n"; $sRet .= $this->Count()." records
\n"; @@ -154,6 +154,7 @@ class DBObjectSet implements iDBObjectSetIterator } $sRet .= "\n"; } + $this->Rewind(); return $sRet; } diff --git a/core/dbsearch.class.php b/core/dbsearch.class.php index e0eb85cbe..fa1c99929 100644 --- a/core/dbsearch.class.php +++ b/core/dbsearch.class.php @@ -1717,6 +1717,6 @@ abstract class DBSearch */ public function __toString() { - return $this->ToOQL(); + return $this->ToOQL(true); } } diff --git a/core/restservices.class.inc.php b/core/restservices.class.inc.php index 518e8a8cd..2a6c1c830 100644 --- a/core/restservices.class.inc.php +++ b/core/restservices.class.inc.php @@ -574,7 +574,7 @@ class CoreServices implements iRestServiceProvider $oObject = $oElement->GetProperty('object'); if ($oObject) { - if ($bEnableRedundancy) + if ($bEnableRedundancy && $sDirection == 'down') { // Add only the "reached" objects if ($oElement->GetProperty('is_reached'))