ImportRunBasedPurgeStrategy: fixed combined keys

fixes #2339
This commit is contained in:
Thomas Gelf 2021-07-12 23:11:40 +02:00
parent bf32380d32
commit f27390d503
2 changed files with 6 additions and 3 deletions

View File

@ -48,6 +48,9 @@ next patch release (will be 1.8.1)
* FIX: don't fail when showing a Host overriding multiple inherited groups (#2253)
* FIX: deal with inherited values which are invalid for a select box (#2288)
### Import and Sync
* FIX: Purge didn't remove more than 1000 services at once (#2339)
### Automation, User Interface
* FIX: error message wording on failing related (or parent) object ref (#2224)

View File

@ -71,14 +71,14 @@ class ImportRunBasedPurgeStrategy extends PurgeStrategy
$columns = SyncUtils::getRootVariables(
SyncUtils::extractVariableNames($pattern)
);
$resultForCombinedKey = array();
foreach (array_chunk($result, 1000) as $keys) {
$rows = $runA->fetchRows($columns, null, $keys);
$result = array();
foreach ($rows as $row) {
$result[] = SyncUtils::fillVariables($pattern, $row);
$resultForCombinedKey[] = SyncUtils::fillVariables($pattern, $row);
}
}
$result = $resultForCombinedKey;
}
if (empty($result)) {