Skip to content

Commit 73027dd

Browse files
committed
ACP2E-2631: Hidden directories in pub/media/catalog/product cause disk space issues
1 parent 22b5d72 commit 73027dd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/code/Magento/Catalog/Model/Product/Image.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,8 @@ public function clearCache()
849849
// exceptions, allowing the process to continue smoothly.
850850
try {
851851
$this->_mediaDirectory->delete($directory);
852-
} // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock.DetectedCatch
853-
catch (FileSystemException $e) {
852+
// phpcs:ignore Magento2.CodeAnalysis.EmptyBlock.DetectedCatch
853+
} catch (FileSystemException $e) {
854854
}
855855

856856
$this->_coreFileStorageDatabase->deleteFolder($this->_mediaDirectory->getAbsolutePath($directory));

app/code/Magento/Catalog/Test/Unit/Model/Product/ImageTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ public function testClearCache(): void
523523
* @return void
524524
* @throws FileSystemException
525525
*/
526-
public function testClearCacheWithUnableToDeleteDirectory(): void {
526+
public function testClearCacheWithUnableToDeleteDirectory(): void
527+
{
527528
$this->mediaDirectory->expects($this->once())
528529
->method('delete')
529530
->willThrowException(new FileSystemException(__('Cannot delete non-empty dir.')));

0 commit comments

Comments
 (0)