From bd14096d43fd0807571df663fda9e64547baa568 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 21 Jul 2020 14:21:55 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03150=20-=20Wrong=20count=20for=20archive?= =?UTF-8?q?d=20objects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/ormlinkset.class.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/ormlinkset.class.inc.php b/core/ormlinkset.class.inc.php index 7de3624fa..182568f99 100644 --- a/core/ormlinkset.class.inc.php +++ b/core/ormlinkset.class.inc.php @@ -814,6 +814,17 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator $oNotObsoleteRemote->AddConditionExpression($oNotObsolete); $oLinkSearch->AddCondition_PointingTo($oNotObsoleteRemote, $sExtKeyToRemote); } + if (!utils::IsArchiveMode() && MetaModel::IsArchivable($sTargetClass)) + { + $oNotArchived = new BinaryExpression( + new FieldExpression('archive_flag', $sTargetClass), + '=', + new ScalarExpression(0) + ); + $oNotArchivedRemote = new DBObjectSearch($sTargetClass); + $oNotArchivedRemote->AddConditionExpression($oNotArchived); + $oLinkSearch->AddCondition_PointingTo($oNotArchivedRemote, $sExtKeyToRemote); + } } $oLinkSet = new DBObjectSet($oLinkSearch); $oLinkSet->SetShowObsoleteData($bShowObsolete); @@ -824,4 +835,4 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator return $oLinkSet; } -} \ No newline at end of file +}