magento2: Category image does not copy from catalog/tmp/category to catalog/category directory when saving category whilst using database storage method
Preconditions
- Magento 2.4-develop
Steps to reproduce
- Set media storage to database
- Upload category image in admin section
- Save the category
Expected result
- The image row in media_storage_file_storage table should have directory
catalog/categoryand correctdirectory_id
Actual result
- The image row in media_storage_file_storage table has directory
catalog/tmp/category
I believe the problem lies with the directory_id not being changed in method Magento\MediaStorage\Model\ResourceModel\File\Storage\Database::copyFile
When I manually change the directory_id in $data from the catalog/tmp/category directory_id to the catalog/category directory_id before running the $connection->insertOnDuplicate method the file is correctly copied to another row with the correct data.
As another note, should it not convert the existing row to simply change the directory_id and directory rather than copying to a new row…
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 22 (10 by maintainers)
@davidwindell, sorry that was just mistake.