diff --git a/CHANGELOG.md b/CHANGELOG.md index a16099630f9..61bc741cdc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Updated Twig to 3.14. ([#15704](https://github.com/craftcms/cms/issues/15704)) +- Fixed a bug where soft-deleted structures weren’t getting hard-deleted via garbage collection. ([#15705](https://github.com/craftcms/cms/pull/15705)) - Fixed an RCE vulnerability. ## 4.12.1 - 2024-09-06 diff --git a/src/services/Gc.php b/src/services/Gc.php index 654546ca90e..315bd30ac3e 100644 --- a/src/services/Gc.php +++ b/src/services/Gc.php @@ -609,6 +609,7 @@ private function _hardDeleteStructures(): void ->leftJoin(['r' => $revisionsTable], '[[r.canonicalId]] = coalesce([[e.canonicalId]],[[e.id]])') ->where([ 'and', + ['not', ['se.elementId' => null]], $this->_hardDeleteCondition('s'), [ 'r.canonicalId' => null, @@ -624,7 +625,7 @@ private function _hardDeleteStructures(): void if ($this->db->getIsMysql()) { $sql = <<