Skip to content

Commit

Permalink
Merge pull request #289 from kbergha/master
Browse files Browse the repository at this point in the history
Fixed missing deletion of orphans of split elements
  • Loading branch information
janhenckens authored Feb 13, 2024
2 parents f8a7c37 + e4ef8e7 commit d7dd463
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## Unreleased
### Fixed
- Fixed missing deletion of orphans of split elements ([#259](https://github.com/studioespresso/craft-scout/issues/259))

## 3.3.3-beta.1 - 2023-12-06
### Fixed
- This beta release is a first try at resolving an issue with deindexing of element not working properly. ([#281](https://github.com/studioespresso/craft-scout/issues/281))
Expand Down
15 changes: 6 additions & 9 deletions src/engines/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ public function splitObjects(array $objects): array
$objectToSave['distinctID'] = $objectToSave['objectID'];
$objectsToSave[] = $objectToSave;
}

continue;
}

foreach ($splittedObjects as $part => $splittedObject) {
$splittedObject['distinctID'] = $splittedObject['objectID'];
$splittedObject['objectID'] = "{$splittedObject['objectID']}_{$part}";
$objectsToSave[] = $splittedObject;
} else {
foreach ($splittedObjects as $part => $splittedObject) {
$splittedObject['distinctID'] = $splittedObject['objectID'];
$splittedObject['objectID'] = "{$splittedObject['objectID']}_{$part}";
$objectsToSave[] = $splittedObject;
}
}

$objectsToDelete[] = $object;
}

Expand Down

0 comments on commit d7dd463

Please sign in to comment.