Skip to main content
edited the config.xml content to add the model part
Source Link
Macerier
  • 163
  • 1
  • 4
<?xml version="1.0"?>
<config>
    <modules>
        <Macerier_TEST>
            <version>0.1.0</version>
        </Macerier_TEST>
    </modules>
    <global>
        <models>
            <macerier_test>
                <class>Macerier_TEST_Model</class>
            </macerier_test>
        </models>
    </global>
</config>
<?xml version="1.0"?>
<config>
    <modules>
        <Macerier_TEST>
            <version>0.1.0</version>
        </Macerier_TEST>
    </modules>
</config>
<?xml version="1.0"?>
<config>
    <modules>
        <Macerier_TEST>
            <version>0.1.0</version>
        </Macerier_TEST>
    </modules>
    <global>
        <models>
            <macerier_test>
                <class>Macerier_TEST_Model</class>
            </macerier_test>
        </models>
    </global>
</config>
added 13 characters in body; edited title
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

magento custom system System configuration custom source model error

sistemsystem.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <macerierconf translate="label">
            <label>Macerier</label>
            <sort_order>150</sort_order>
        </macerierconf>
    </tabs>
    <sections>
        <tab1 translate="label" module="adminhtml">
            <label>Settings</label>
            <tab>macerierconf</tab>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <smssending translate="label comment">
                    <label>test label</label>
                    <sort_order>60</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <device translate="label comment">
                            <label>Device</label>
                            <frontend_type>select</frontend_type><source_model>macerier_testfrontend_type>
                            <source_model>macerier_test/system_config_source_dropdown_values</source_model>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </device>
                    </fields>
                </smssending>
            </groups>
        </tab1>
    </sections>
</config>

and iI get this error:

iI am sure i'mI'm doing something wrong here because without the custom source model the module is working.

magento custom system configuration error

sistem.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <macerierconf translate="label">
            <label>Macerier</label>
            <sort_order>150</sort_order>
        </macerierconf>
    </tabs>
    <sections>
        <tab1 translate="label" module="adminhtml">
            <label>Settings</label>
            <tab>macerierconf</tab>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <smssending translate="label comment">
                    <label>test label</label>
                    <sort_order>60</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <device translate="label comment">
                            <label>Device</label>
                            <frontend_type>select</frontend_type><source_model>macerier_test/system_config_source_dropdown_values</source_model>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </device>
                    </fields>
                </smssending>
            </groups>
        </tab1>
    </sections>
</config>

and i get this error

i am sure i'm doing something wrong here because without the custom source model the module is working.

System configuration custom source model error

system.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <macerierconf translate="label">
            <label>Macerier</label>
            <sort_order>150</sort_order>
        </macerierconf>
    </tabs>
    <sections>
        <tab1 translate="label" module="adminhtml">
            <label>Settings</label>
            <tab>macerierconf</tab>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <smssending translate="label comment">
                    <label>test label</label>
                    <sort_order>60</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <device translate="label comment">
                            <label>Device</label>
                            <frontend_type>select</frontend_type>
                            <source_model>macerier_test/system_config_source_dropdown_values</source_model>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </device>
                    </fields>
                </smssending>
            </groups>
        </tab1>
    </sections>
</config>

and I get this error:

I am sure I'm doing something wrong here because without the custom source model the module is working.

added config.xml source file
Source Link
Macerier
  • 163
  • 1
  • 4

sistem.xml

sistem.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <macerierconf translate="label">
            <label>Macerier</label>
            <sort_order>150</sort_order>
        </macerierconf>
    </tabs>
    <sections>
        <tab1 translate="label" module="adminhtml">
            <label>Settings</label>
            <tab>macerierconf</tab>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <smssending translate="label comment">
                    <label>test label</label>
                    <sort_order>60</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <device translate="label comment">
                            <label>Device</label>
                            <frontend_type>select</frontend_type><source_model>macerier_test/system_config_source_dropdown_values</source_model>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </device>
                    </fields>
                </smssending>
            </groups>
        </tab1>
    </sections>
</config>

then in Macerier\TEST\Model\System\Config\Source\Dropdown\Values.php I have this:

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Macerier_TEST>
            <version>0.1.0</version>
        </Macerier_TEST>
    </modules>
</config>

then in Macerier\TEST\Model\System\Config\Source\Dropdown\Values.php I have this:

sistem.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <macerierconf translate="label">
            <label>Macerier</label>
            <sort_order>150</sort_order>
        </macerierconf>
    </tabs>
    <sections>
        <tab1 translate="label" module="adminhtml">
            <label>Settings</label>
            <tab>macerierconf</tab>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <smssending translate="label comment">
                    <label>test label</label>
                    <sort_order>60</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <device translate="label comment">
                            <label>Device</label>
                            <frontend_type>select</frontend_type><source_model>macerier_test/system_config_source_dropdown_values</source_model>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </device>
                    </fields>
                </smssending>
            </groups>
        </tab1>
    </sections>
</config>

then in Macerier\TEST\Model\System\Config\Source\Dropdown\Values.php I have this:

sistem.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <macerierconf translate="label">
            <label>Macerier</label>
            <sort_order>150</sort_order>
        </macerierconf>
    </tabs>
    <sections>
        <tab1 translate="label" module="adminhtml">
            <label>Settings</label>
            <tab>macerierconf</tab>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <smssending translate="label comment">
                    <label>test label</label>
                    <sort_order>60</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <device translate="label comment">
                            <label>Device</label>
                            <frontend_type>select</frontend_type><source_model>macerier_test/system_config_source_dropdown_values</source_model>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </device>
                    </fields>
                </smssending>
            </groups>
        </tab1>
    </sections>
</config>

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Macerier_TEST>
            <version>0.1.0</version>
        </Macerier_TEST>
    </modules>
</config>

then in Macerier\TEST\Model\System\Config\Source\Dropdown\Values.php I have this:

Source Link
Macerier
  • 163
  • 1
  • 4
Loading