Skip to content

Commit

Permalink
Don't prune nested entry revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 14, 2025
1 parent 7b88952 commit 96ffcf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fixed a bug where Single section entries could be duplicated after running the `entry-types/merge` command. ([#16394](https://github.com/craftcms/cms/issues/16394))
- Fixed a styling bug with the system message modal. ([#16410](https://github.com/craftcms/cms/issues/16410))
- Fixed a bug where relational fields could eager-load elements from a different instance of the same field, if one of the instances had no relations. ([#16191](https://github.com/craftcms/cms/issues/16191))
- Fixed a bug where the `utils/prune-revisions` command was deleting nested entry revisions.

## 5.5.9 - 2025-01-06

Expand Down
8 changes: 8 additions & 0 deletions src/console/controllers/utils/PruneRevisionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ public function actionIndex(): int
$subQuery
->innerJoin(['entries' => Table::ENTRIES], '[[entries.id]] = [[r.canonicalId]]')
->andWhere(['entries.sectionId' => $sectionIds]);
} else {
$subQuery
->leftJoin(['entries' => Table::ENTRIES], '[[entries.id]] = [[r.canonicalId]]')
->andWhere([
'or',
['entries.id' => null],
['not', ['entries.sectionId' => null]],
]);
}

$this->stdout('Finding elements with too many revisions ... ');
Expand Down

0 comments on commit 96ffcf6

Please sign in to comment.