Magento system.xml 缓存问题

发布于 2024-12-15 05:27:37 字数 350 浏览 2 评论 0原文

我一直在构建一个模块并进行大量更改,没有任何问题,直到现在:

我从扩展的 system.xml 文件中删除了一个配置变量,但该字段仍在配置中。我禁用了所有缓存,刷新了所有缓存(通过 magento admin 和手动删除目录中的所有内容),但它仍然不会消失。

作为测试,我使用相同的节点名称将其添加回 system.xml 文件,但更改了标签,并且它接受了更改。我还可以通过将 设置为 0 来隐藏它。但是,在它消失后,我将其从 system.xml 文件中删除,然后它再次出现在行政。我必须想象这是一个缓存问题,但我不知道要刷新什么才能让它消失。

有什么想法吗?

I have been building a module and making numerous changes without any problems until just now:

I removed a configuration variable from my extension's system.xml file but the field is still in the config. I disabled all caching, flushed all caches (both through magento admin and by manually deleting everything in the directories) but it STILL won't go away.

As a test, I added it back to the system.xml file using the same node name but changing the label and it picked up the change. I was also able to hide it by setting <show_in_...> to 0. However, after it went away, I removed it from the system.xml file and it showed up again in the admin. I have to imagine this is a caching issue but I can't figure out what to flush to make it go away.

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水中月 2024-12-22 05:27:37

有两件事需要检查。当您保存配置值时,magento(当前)将其保存到 core_config_data 表中。即使您从 system.xml 配置中删除配置字段。该路径/值对仍将存储在该数据库中。执行一下

SELECT * FROM core_config_data WHERE path = '/foo/baz/bar'

以查看其中是否还有值。如果是,调用 Mage::getStoreConfig 仍将返回一个值,无论 system.xml 中的内容如何。

其次,Magento 允许您为每个存储存储一个默认值。 config.xml 中的配置路径。 在节点下查找

<default>
   <foo>
       <baz>
           <bar>1</bar>
       </baz>
   </foo>
</default>

与您的配置路径匹配的嵌套树路径。如果此节点存在,则针对 Mage::getStoreConfig 的请求将返回该值。

Two things to check. When you save a configuration value, magento (currently) persists it to the core_config_data table. Even if you remove the configuration field from your system.xml config. that path/value pair will still be stores in this database. Do a

SELECT * FROM core_config_data WHERE path = '/foo/baz/bar'

To see if there's still a values in there. If it is, calls to Mage::getStoreConfig will still return a value, again regardless of what's in system.xml

Secondly, Magento allows you to stores a default value for each configuration path in config.xml. Look under the

<default>
   <foo>
       <baz>
           <bar>1</bar>
       </baz>
   </foo>
</default>

node for a nested tree path that matches your configuration path. If this node is present then this value will be returned for requests to Mage::getStoreConfig.

红颜悴 2024-12-22 05:27:37

system.xml 值存储在数据库中,core_config_data:您已将其删除吗?

system.xml values are stored in the db, core_config_data: have you delete it there?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文