我正在尝试使用 Magento 的 EAV 结构创建自定义模块,并一直使用本教程作为指南: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-7-advanced-orm-entity-attribute-value
一切似乎都正常除了我的安装脚本在尝试创建 _text 表时总是失败。它创建前 3 个 -entityname_datetime、entityname_int 和entityname_decimal,然后抛出异常:无法从核心资源设置模型创建表:entityname_text。
我尝试更改表名称,但在同一点失败。除了更改模型和实体名称之外,我的代码与教程中的内容完全一致。
有什么调试技巧吗?在核心资源设置模型中使用 Mage::log 似乎不起作用,尽管我无法理解为什么。
I'm trying to create a custom module using Magento's EAV structure and have been using this tutorial as a guide: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-7-advanced-orm-entity-attribute-value
Everything seems to be working except my install script is always failing on trying to create the _text table. It creates the first 3 - entityname_datetime, entityname_int and entityname_decimal and then throws the exception: Can't create table: entityname_text from the core resource setup model.
I've tried changing the table name but it fails at the same point. Except for changing the model and entity names, my code exactly mirrors that from the tutorial.
Any tips for debugging? Using Mage::log within the core resource setup model doesn't seem to be working, though I can't fathom why.
发布评论
评论(3)
这是最近在该产品的社区版版本中引入的错误。已通过他们的 public-with-a-login 错误跟踪器< /a>.现在,我将跳过创建非 varchar 文本类型并继续完成本教程。 (并不理想,但正如教程所建议的,您会发现这是一个需要临时 EAV 模型的罕见用例)
This is bug that was recently introduced to the Community Edition version of the product. It's been reported to the core team via their public-with-a-login bug tracker. For now I'd skip creating non-varchar text types and continue working your way through the tutorial. (not ideal, but as the tutorial suggests, you'll it's a rare use-case that calls for a scratch EAV model)
更改表名称后,您是否尝试从模块的 core_resource 表中删除条目并清除缓存?顺便说一句,你用的是什么名字?
after changing table name have u tried removing entry from core_resource table of your module and clearing the cache? btw, what name you are using?
Magento 团队的解决方案 错误报告参考链接
solution by Magento Team bug report reference link