Magento 类别丢失“include_in_menu”价值——如何?
Magento CE 1.4(也称为 EE 1.8)为类别实体引入了一个新属性; include_in_menu
。我非常仔细地检查过,没有任何代码将其设置为除“1”之外的任何值。默认值为“1”。没有一个选项可以控制它。然而,当我的某些类别从导航中消失时,我发现该属性已被清除。
我可以看到 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php
添加了属性的过滤器,这就是读取值的方式。果然,如果我强行清除数据库中的值,这些记录就会被正确过滤掉并从前端导航中消失。
我已经重置了所有值,现在工作正常。但是我不明白为什么会出错,也不明白如何防止它再次发生。有人可以建议可能的原因吗?
Magento CE 1.4 (also EE 1.8) introduced a new attribute to category entities; include_in_menu
. I've checked very carefully and no code ever sets it to anything but "1". The default value is "1". There isn't an option to control it. And yet when some of my categories disappeared from the navigation I found this attribute had been cleared.
I can see app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php
adds a filter for the attribute, this is how the value is being read. Sure enough, if I forcibly clear the value in the database those records are correctly filtered out and disappear from the front end navigation.
I've since reset all the values and it works fine now. However I don't understand why it went wrong nor how to prevent it happening again. Can anyone please suggest possible causes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
管理员中“一般信息”选项卡上“管理类别”下有一个名为“包含在导航菜单中”的用户控件。这个值有可能是手动切换的吗?
There's a user control in the admin under Manage Categories on the General Information tab called "Include in Navigation Menu". Is it possible that this value was toggled manually?