File tree Expand file tree Collapse file tree 4 files changed +34
-1
lines changed
Expand file tree Collapse file tree 4 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ class ConfigFieldPlugin
1717 const SCOPE_TYPE_WEBSITES = 'websites ' ;
1818 const SCOPE_TYPE_STORES = 'stores ' ;
1919
20+ private const CONFIG_SHOW_PATH = 'dev/debug/show_path_in_adminhtml ' ;
21+
2022 /** @var Escaper */
2123 private $ escaper ;
2224
@@ -92,6 +94,10 @@ public function afterGetData(
9294 Subject $ subject ,
9395 array $ result
9496 ) {
97+ if (!$ this ->scopeConfig ->isSetFlag (self ::CONFIG_SHOW_PATH )) {
98+ return $ result ;
99+ }
100+
95101 $ result ['path_hint ' ] = '<small> ' . __ ('Path: <code>%1</code> ' , $ this ->getPath ($ subject ) . '</small> ' );
96102
97103 return $ result ;
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Config:etc/system_file.xsd" >
4+ <system >
5+ <section id =" dev" >
6+ <group id =" debug" >
7+ <field id =" show_path_in_adminhtml" translate =" label" type =" select" sortOrder =" 10" showInDefault =" 1" showInWebsite =" 0" showInStore =" 0" canRestore =" 1" >
8+ <label >Display path for each option in system configuration</label >
9+ <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
10+ </field >
11+ </group >
12+ </section >
13+ </system >
14+ </config >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Store:etc/config.xsd" >
4+ <default >
5+ <dev >
6+ <debug >
7+ <show_path_in_adminhtml >1</show_path_in_adminhtml >
8+ </debug >
9+ </dev >
10+ </default >
11+ </config >
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ See the screenshot to get an impression of what the module does:
1717
1818![ Screenshot] ( scopehint2-screenshot.png?raw=true " ScopeHint for Magento 2 ")
1919
20- The module also displays the configuration code (which is used for ` ScopeConfigInterface::getValue() ` ) with the configuration fields.
20+ The module also optionally displays the configuration code (which is used for ` ScopeConfigInterface::getValue() ` ) with the configuration fields.
21+ This is on by default, and can be enabled/disabled in
22+ Stores -> Settings -> Configuration -> Advanced -> Developer -> Debug -> ` Display path for each option in system configuration `
2123
2224Requirements
2325------------
You can’t perform that action at this time.
0 commit comments