Magento module system.xml复选框赢得';救不了

Magento module system.xml复选框赢得';救不了,magento,magento-1.5,Magento,Magento 1.5,在Magento v1.5.0.1中,是否有人知道使用system.xml中的复选框配置指令会出现问题?即使是最简单的哑模块,只有一个配置变量,没有块/模型,如果我选中复选框并点击“保存”,它会在取消选中复选框的情况下重新加载页面,即使它说配置已成功保存。我搜索了代码,它只在几个地方使用。大多数情况下,人们使用select和adminhtml/system\u config\u source\u yesno。这是可行的,但是为什么复选框不起作用呢?还是我误解了Magento复选框的工作原理 如果

在Magento v1.5.0.1中,是否有人知道使用system.xml中的
复选框
配置指令会出现问题?即使是最简单的哑模块,只有一个配置变量,没有块/模型,如果我选中复选框并点击“保存”,它会在取消选中复选框的情况下重新加载页面,即使它说配置已成功保存。我搜索了代码,它只在几个地方使用。大多数情况下,人们使用
select
adminhtml/system\u config\u source\u yesno
。这是可行的,但是为什么复选框不起作用呢?还是我误解了Magento复选框的工作原理

如果有用的话,这是我的文件。在本例中,我还添加了一个文本字段变量。如果我输入文本并点击save,则会保存,但复选框不会:

config.xml:

0.1.0
愚蠢的废话
system.xml:

愚蠢的测试
目录
文本
998
1.
1.
1.
调试
文本
5.
1.
1.
1.
调试模式启用
如果启用,则不会更改数据库。打印调试消息并终止
复选框
5.
1.
1.
1.
文本测试
文本
10
1.
1.
1.

我花了一些时间来得到一个解决方案,但除了一个解决方案之外,什么都没有

看看Mage文件夹中的PayPal模块。这是唯一一个使用复选框的模块,但是它们的设置非常困难


我想这就是为什么每个人都使用select with yesno或enabledisable源代码的原因。

我向您发布了我的解决方案,因为我面临着类似的情况

基本上,问题在于magento只在db中保存输入参数“value”,而在输入复选框中,重要值为“Checked”

我尝试放置一些js,当复选框更改时,根据此设置输入值,当页面加载执行相反操作时。。。这不管用

替代解决方案:使用下拉列表


调试模式启用
如果启用,则不会更改数据库。打印调试消息并终止
挑选
adminhtml/system\u config\u source\u yesno
10
1.
1.
1.

我在PayPal模块中也注意到了这一点,但我无法理解。有时间我会再看一看,看我是否能理解它。现在,yes/no可以很好地工作,但是我希望有人阅读这个线程,了解更多关于复选框的信息。任何人
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Brian_Stupid>
            <version>0.1.0</version>
        </Brian_Stupid>
    </modules>
    <adminhtml>
        <acl>
            <resources>
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <stupid translate="title">
                                            <title>Stupid Crap</title>
                                        </stupid>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
</config>
<?xml version="1.0"?>
<config>
    <sections>
        <stupid translate="label">
            <label>Stupid Test</label>
            <tab>catalog</tab>
            <frontend_type>text</frontend_type>
            <sort_order>998</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <debug translate="label">
                    <label>Debugging</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>5</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <debugmode translate="label">
                            <label>Debug Mode Enable</label>
                            <comment>If enabled, does not alter database. Prints debug messages and dies</comment>
                            <frontend_type>checkbox</frontend_type>
                            <sort_order>5</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </debugmode>
                        <texttest translate="label">
                            <label>Text Test</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>10</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </texttest>
                    </fields>
                </debug>
            </groups>
        </stupid>
    </sections>
</config>
 <debugmode translate="label">
                        <label>Debug Mode Enable</label>
                        <comment>If enabled, does not alter database. Prints debug messages and dies</comment>
                        <frontend_type>select</frontend_type>                                                                     
                        <source_model>adminhtml/system_config_source_yesno</source_model>     
                        <sort_order>10</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </debugmode>