Question

I have set default file name in textbox but it's not working. Can you please guide me where I went wrong?

my Code is:

app/code/learning/Custom/etc/adminhtml/system.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd">
    <system>
        <tab id="custom" translate="label" sortOrder="0">
            <label>Custom Extension</label>
        </tab>
        <section id="custom_customer" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Customer</label>
            <tab>custom</tab>
            <resource>Learning_Custom::config_custom</resource>
            <group id="magento_customer_logs" translate="label" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Magento Customer Logs</label>
                <field id="magento_request" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Magento Customer Request</label>
                </field>
                <field id="magento_response" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Magento Customer Response</label>
                </field>
            </group>
        </section>
    </system>
</config>

app/code/learning/Custom/etc/acl.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="Learning_Custom::config_custom" title="Custom Section" sortOrder="80" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

app/code/learning/Custom/etc/config.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd">
    <default>
        <custom_customer>
            <magento_customer_logs>
                <magento_request>magento_request</magento_request>
                <magento_response>magento_response</magento_response>
            </magento_customer_logs>
        </custom_customer>
    </default>
</config>

Could you please let me know where I went wrong?

Was it helpful?

Solution

System.xml looks like

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="custom" translate="label" sortOrder="0">
            <label>Custom Extension
        </tab>
        <section id="custom_customer" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Customer</label>
            <tab>custom</tab>
            <resource>Learning_Custom::config_custom</resource>
            <group id="magento_customer_logs" translate="label" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Magento Customer Logs</label>
                <field id="magento_request" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Magento Customer Request</label>
                </field>
                <field id="magento_response" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Magento Customer Response</label>
                </field>
            </group>
        </section>
    </system>
</config>

acl.xml looks like

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="Learning_Custom::config_custom" title="Custom Section" sortOrder="80" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

config.xml looks like

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <custom_customer>
            <magento_customer_logs>
                <magento_request>magento_request</magento_request>
                <magento_response>magento_response</magento_response>
            </magento_customer_logs>
        </custom_customer>
    </default>
</config>

Try it.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top