diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 8c0880fe0..b58832f3d 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -2051,7 +2051,7 @@ abstract class DBObject { $sRemoteName = $oAttDef->IsIndirect() ? $oAttDef->GetExtKeyToRemote().'_friendlyname' : 'friendlyname'; - $oLinkSet = $this->Get($sAttCode); + $oLinkSet = clone $this->Get($sAttCode); // Workaround/Safety net for Trac #887 $iLimit = MetaModel::GetConfig()->Get('max_linkset_output'); if ($iLimit > 0) { diff --git a/core/dbobjectset.class.php b/core/dbobjectset.class.php index b5015d416..fc00fd564 100644 --- a/core/dbobjectset.class.php +++ b/core/dbobjectset.class.php @@ -418,7 +418,7 @@ class DBObjectSet CMDBSource::FreeResult($resQuery); $this->m_iCount = $aRow['COUNT']; } - return $this->m_iCount; + return $this->m_iCount; // WARNING this value can be wrong, see Trac #887 } }