-
-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * @copyright For copyright and license information, read the COPYING.txt file. | ||
| * @link /COPYING.txt | ||
| * @license Open Software License (OSL 3.0) | ||
| * @package Mage_Adminhtml | ||
| */ | ||
|
|
||
| /** | ||
| * @package Mage_Adminhtml | ||
| */ | ||
| class Mage_Adminhtml_Model_System_Config_Source_Catalog_ImageFileHandle | ||
| { | ||
| public function toOptionArray() | ||
| { | ||
| 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)')], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| ]; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,6 +213,16 @@ | |
| <show_in_website>1</show_in_website> | ||
| <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> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| <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> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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> |
||
| <frontend_type>select</frontend_type> | ||
| <source_model>adminhtml/system_config_source_catalog_imageFileHandle</source_model> | ||
| <sort_order>50</sort_order> | ||
| <show_in_default>1</show_in_default> | ||
| <show_in_website>1</show_in_website> | ||
| <show_in_store>1</show_in_store> | ||
| </images_on_removal_action> | ||
| </fields> | ||
| </product_image> | ||
| <placeholder translate="label"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1321,3 +1321,7 @@ | |
| "Duplicate product without images","Duplicate product without images" | ||
| "Copy Images on Duplicate","Copy Images on Duplicate" | ||
| "'Ask' option only affects Admin interface. Default for programmatical duplication is to persist images.","'Ask' option only affects Admin interface. Default for programmatical duplication is to persist images." | ||
| "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)" | ||
|
Comment on lines
+1324
to
+1327
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These sentences must be changed too. |
||
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.