A "Restore to default" button or checkbox would be useful for the fields in System->Configuration that would just delete the value in the table core_config_data thus making Magento use the value declared in config.xml, or an empty value if that does not exist.
If not all fields should be allowed to be "restored to default" maybe this can be managed from system.xml with a new attribute on the <field> tag. Example
<field id="list_mode" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="0"><!-- or canRestore="1" -->
<label>List Mode</label>
<source_model>Magento\Catalog\Model\Config\Source\ListMode</source_model>
</field>
+1 great idea
+1
+1
I would be very useful and fairly easy to implement
El 26/08/2014 12:50, "Guillaume Deneux" [email protected] escribió:
+1
—
Reply to this email directly or view it on GitHub
https://github.com/magento/magento2/issues/404#issuecomment-53443103.
+1
+1
I just wanted to add more details on how I would see this implemented.
So the "Restore to default" checkbox should appear only on the Default config screen.
If the user checks the checkbox, only the value for the selected path with the scope 'default' will be deleted.
If the user wants to reset a value at store view or website level, he can do it like it is done now.
Change the scope to store view and check the checkbox Use Website.
Change the scope to website and check the checkbox Use Default.
In my opinion all the cases should be covered by this approach.
+1
+1
+1
Hello @tzyganu ,
Thank you for the interesting suggestion.
3rd party modules also use core_config_data table to save their settings.
Adding this feature means to impose the condition that these modules should support drop settings option too. What are thoughts on that?
@Tiurnikova
I see no problem about this.
If the third party modules have the attribute canRestore="0" (see my initial statement) for a specific config setting it should work the same.
I realize now that maybe I didn't explain my idea correctly.
this "restore to default" checkbox should be specific for each config setting.
Just like you have a checkbox right now with "Use default value" when editing the config on a website scope.
From what I found, if you edit the config on a website level and you check the "Use default value" checkbox, the value stored in the core_config_data for that specific setting for the specific website is deleted. Am I right?
My idea was to have the "Restore to default " checkbox on the "Default config" scope for each config setting that supports it. If that is checked and I hit "Save", the value for the default config will also be deleted from the table core_config_data letting magento use the value declared in the config.xml.
Just to make it clear... I wasn't reffering to a "Restore to factory settings" feature that would delete everything in the core_config_data. That would be dangerous indeed.
Just one "restore" for every setting (field) that appears in System->Configuration.
Let me know if this time I made it clear.
@tzyganu, yes. Now it's clear. Thank you for clarification.
You mean - ability to restore settings to default for each field separately. Got it.
That definitely makes sense.
MAGETWO-34400
Since the PR was merged, I will close this issue.
So after the 2.5 years that have passed since this issue was opened, I can finally make the stupid joke. Issue #404..."Issue not found".
Very helpful information
Most helpful comment
Since the PR was merged, I will close this issue.
So after the 2.5 years that have passed since this issue was opened, I can finally make the stupid joke. Issue #404..."Issue not found".