Skip to content

Commit 14c56d0

Browse files
committed
Fixed #16388, part 2
1 parent 42fd157 commit 14c56d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Fixed a bug where the Login Page Logo general setting had inaccurate instructions. ([#16482](https://github.com/craftcms/cms/issues/16482))
99
- Fixed a bug where element indexes’ View menus could have a horizontal scrollbar. ([#16473](https://github.com/craftcms/cms/issues/16473))
1010
- Fixed a bug where info icons weren’t shown within slideouts.
11+
- Fixed a bug where the `utils/delete-empty-volume-folders` command was deleting folders that had no assets directly, but had subfolders. ([#16388](https://github.com/craftcms/cms/issues/16388))
1112

1213
## 5.6.0.2 - 2025-01-21
1314

src/console/controllers/utils/DeleteEmptyVolumeFoldersController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ public function actionIndex(): int
4848
->select(['folders.id'])
4949
->from(['folders' => Table::VOLUMEFOLDERS])
5050
->leftJoin(['assets' => Table::ASSETS], '[[assets.folderId]] = [[folders.id]]')
51-
->where(['assets.id' => null])
51+
->leftJoin(['subfolders' => Table::VOLUMEFOLDERS], '[[subfolders.parentId]] = [[folders.id]]')
52+
->where([
53+
'assets.id' => null,
54+
'subfolders.id' => null,
55+
])
5256
->andWhere(['not', ['folders.parentId' => null]])
5357
->andWhere(['not', ['folders.path' => null]]);
5458

0 commit comments

Comments
 (0)