2

I have created a module that has it's own Magento admin configurations. The module and its configurations are working fine. However, when I zipped the module and install it in a fresh Magento installation for testing, the configuration section is displaying a blank page.

The other parts of the module look fine but the configuration section of the module is blank.

Here is my system.xml file,

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">     
    <system>

        <!--For add new tab in Magento2 system configuration section -->
        <tab id="xxxx" translate="label" sortOrder="10">
            <label>xxxx Extension</label>
        </tab>

        <!--For creating section -->
        <section id="quotes" translate="label" type="text" sortOrder="320" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Module</label>

            <!--Assign section to tab -->
            <tab>test</tab>
            <resource>Vendor_Module::configuration</resource>

            <!--create group for fields in section -->
            <group id="quotes" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Request </label>

                <!--create text type field -->
                <field id="enabled" translate="label" sortOrder="7" type="select" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Enable Request</label>
                    <comment>select from the dropdown</comment>

<!-- source model which we created for drop down options -->
       <source_model>Vendor\Module\Model\Config\Source\Module</source_model>
                </field>
            </group> 

            <group id="email" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Email Options</label>

                <!-- create text type field -->
                <field id="send_email" translate="label comment" sortOrder="7" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Emails To</label>
                    <comment>email@domain.com</comment>
                    <validate>validate-email required-entry</validate>
                </field>

                <field id="email_sender" translate="label comment" sortOrder="7" type="select" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Email Sender</label>

                    <!-- Adding model for email identitiy -->
                    <source_model>Magento\Config\Model\Config\Source\Email\Identity</source_model>
       <comment>select from the dropdown</comment>
                </field>

                <field id="email_template" translate="label comment" sortOrder="7" type="select" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Email Template</label>
                    <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment>                    
                    <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
                </field>

                <field id="email_quote" translate="label comment" sortOrder="7" type="select" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Email Quote</label>
                    <comment>select from the dropdown</comment>
                    <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>                 
                </field> 
            </group>
        </section>       
    </system>
</config>

My acl.xml file,

<?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="Vendor_Module::xxxx" title="XXXXX" 
                          sortOrder="100">
                    <resource id="Vendor_Module::quotes" title="Quotes" 
                              sortOrder="1" />
                    <resource id="Vendor_Module::requests" title="Requests" 
                              sortOrder="2" />
                    <resource id="Vendor_Module::configuration" title="Configurations" 
                              sortOrder="3" />
                </resource>
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">                           
                            <resource id="Vendor_Module::config_xxxx" title="Module_config" sortOrder="80" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

Please, can anyone help? I am not sure why would this happen.

  • Did you try to logout and login again? Have you also created an acl.xml file? – Nikolas Nov 29 '17 at 9:02
  • Yes, I have tried that. Please see the edit with acl.xml – coderunner Nov 29 '17 at 9:17
  • Have you check log file when it show blank page? – Dhiren Vasoya Nov 29 '17 at 10:43
  • I'm trying to use same source model for two fields ( Email templates in dropdown twice). It is not displaying the second field and loading with blank configuration page. ><source_model>Magento\Config\Model\Config\Source\Email\Template</source_model> – coderunner Nov 29 '17 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.