Some Files Disappeared After Deleting a Folder in Media Gallery
Author: suganu25Created Sep 28, 2023Updated Sep 28, 2026
LabelsIssue: ConfirmedComponent: MediaGalleryReproduced on 2.4.xPriority: P2Area: Content / CMSReported on 2.4.4
Preconditions
- Magento OpenSource 2.4.4/2.4.3
Steps to reproduce
- Login the Magento Back Office.
- Create two folders with matching prefixes on the same path in Media Gallery, for example, one named “abc” and the other “abc123”. These two folders are in the “category” folder.
- Upload some files into both folders.
- Delete the “abc” folder using the delete button in Media Gallery.
Expected result
- The “abc” folder has been deleted.
- The “abc123” folder has not been deleted.
- All files in the “abc123” folder can be found.
Actual result
- The “abc” folder has been deleted (this is the same as the expected result above).
- The “abc123” folder has not been deleted (this is the same as the expected result above).
- All files in the “abc123” folder cannot be found.
- However, all files in the “abc123” folder have not actually been deleted, and we were able to make the files appear after running the command “php bin/magento media-gallery:sync”.
If someone knows how to avoid the problem, please let me know it.
Source: magento/magento2