-
-
Notifications
You must be signed in to change notification settings - Fork 450
Media Gallery behavior when product is deleted or image removed from media gallery: Delete from filesystem #5224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ted or when an image is removed from a product’s media gallery. - it contains failsafe that prevents unintended removal of shared images used across multiple products.
|
| <show_in_store>1</show_in_store> | ||
| </images_on_duplicate_action> | ||
| <images_on_removal_action translate="label comment"> | ||
| <label>Product image file handling on removal</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Delete Product Images Management" is a concise and clear label for managing product images upon deletion. Each word must start with a capital letter as a standard convention in Magento 1 UI/UX design to maintain consistency and readability, especially in settings or configuration sections.
This label will follow the same format as the one above it in the section, 'Duplicate Product Images' – proposed in a PR I opened today.
| public function toOptionArray() | ||
| { | ||
| return [ | ||
| ['value' => Mage_Catalog_Model_Product_Image::ON_REMOVAL_KEEP, 'label' => Mage::helper('adminhtml')->__('Keep image file(s) on the filesystem')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Keep the images on the filesystem" - is clearer and more straightforward than the initial one. By using "the images", we specify the exact object being referred to, making the options more precise. Removing unnecessary complexity, like the plural indicator "(s)," and using simple, direct language improves readability and ensures better understanding for the user. The word 'file' is omitted because it is understood that images are stored as files on the filesystem, making it unnecessary to repeat 'file' in the label.
| { | ||
| return [ | ||
| ['value' => Mage_Catalog_Model_Product_Image::ON_REMOVAL_KEEP, 'label' => Mage::helper('adminhtml')->__('Keep image file(s) on the filesystem')], | ||
| ['value' => Mage_Catalog_Model_Product_Image::ON_REMOVAL_DELETE, 'label' => Mage::helper('adminhtml')->__('Permanently deletes image file(s)')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Permanently delete the images" - is clearer and more straightforward than the initial one. By using "the images", we specify the exact object being referred to, making the options more precise. Removing unnecessary complexity, like the plural indicator "(s)," and using simple, direct language improves readability and ensures better understanding for the user. The word 'file' is omitted because it is understood that images are stored as files on the filesystem, making it unnecessary to repeat 'file' in the label.
| </images_on_duplicate_action> | ||
| <images_on_removal_action translate="label comment"> | ||
| <label>Product image file handling on removal</label> | ||
| <comment><![CDATA[Defines how product image files are handled when a product is deleted or when an image is removed from the product media gallery.<br/><br/><strong>Important:</strong> image files referenced by other products will not be deleted. Only image files that are no longer associated with any product are eligible for removal.]]></comment> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modification of the sentences:
1 - "Defines how the product images are managed when a product is deleted or an image is removed from the product media gallery."
2 - "Important! Images used by other products will not be deleted. Only those that are no longer associated with any product can be deleted." - please note the exclamation mark.
3 - Important! must be in red color - here is an example from the existing code
<comment><![CDATA[<strong style="color:red">Important!</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed.]]></comment>| "Product image file handling on removal","Product image file handling on removal" | ||
| "Defines how product image files are handled when a product is deleted or when an image is removed from the product media gallery.<br/><br/><strong>Important:</strong> image files referenced by other products will not be deleted. Only image files that are no longer associated with any product are eligible for removal.","Defines how product image files are handled when a product is deleted or when an image is removed from the product media gallery.<br/><br/><strong>Important:</strong> image files referenced by other products will not be deleted. Only image files that are no longer associated with any product are eligible for removal." | ||
| "Keep image file(s) on the filesystem","Keep image file(s) on the filesystem" | ||
| "Permanently deletes image file(s)","Permanently deletes image file(s)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These sentences must be changed too.
|
Except for the texts that are easy to change, this PR is well elaborated and implemented. Thank you @m-michalis for your contribution. I kindly ask those who have some time available to test and get it ready for 2.17.0. |



This is the 2nd PR based on @addison74's #5026 (comment)
Parts:
Keep/Skip product images (this pr): Ask whether to keep or skip product images on "Duplicate" + configuration for automating this behaviorMedia Gallery behavior when duplicating a product: Keep/Skip product images #5083Description
This PR controls how product image files are handled when a product is deleted or when an image is removed from a product’s media gallery. Depending on the selected behavior, image files may be retained on the filesystem or permanently deleted to prevent orphaned media and reduce storage usage.
System > Configuration > Catalog > Product Image > Product image file handling on removal