diff --git a/app/QueryGenerator.php b/app/QueryGenerator.php index 6b62297a8bc..071b1566caa 100644 --- a/app/QueryGenerator.php +++ b/app/QueryGenerator.php @@ -1003,7 +1003,8 @@ public function loadJoin() } if ($this->searchFieldsForDuplicates) { $duplicateCheckClause = []; - $queryGenerator = new self($this->moduleName, $this->user->getId()); + $queryGenerator = new self($this->moduleName, $this->user->getId()); + $queryGenerator->setStateCondition($this->getState()); $queryGenerator->permissions = $this->permissions; $queryGenerator->setFields(array_keys($this->searchFieldsForDuplicates)); foreach ($this->searchFieldsForDuplicates as $fieldName => $ignoreEmptyValue) {