diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 52deb38685..2d627b6813 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -2311,7 +2311,6 @@ private function GetUniquenessRuleGenericMessage(string $sCurrentClass, string $ protected function HasObjectsInDbForUniquenessRule($sUniquenessRuleId, $aUniquenessRuleProperties) { $oUniquenessQuery = $this->GetSearchForUniquenessRule($sUniquenessRuleId, $aUniquenessRuleProperties); - $oUniquenessQuery->AllowAllData(); $oUniquenessDuplicates = new DBObjectSet($oUniquenessQuery); $bHasDuplicates = $oUniquenessDuplicates->CountExceeds(0); @@ -2357,6 +2356,8 @@ protected function GetSearchForUniquenessRule($sUniquenessRuleId, $aUniquenessRu $oUniquenessQuery->AddConditionForInOperatorUsingParam('finalclass', $aChildClassesWithRuleDisabled, false); } + $oUniquenessQuery->AllowAllData(); + return $oUniquenessQuery; }