swiftotter/attribute-index-fix

N/A

安装量: 1,416

依赖: 0

建议者: 0

安全性: 0

星标: 1

关注者: 3

分支: 3

类型:magento2-module

v2.2 2018-02-06 17:15 UTC

This package is not auto-updated.

Last update: 2024-09-17 03:39:04 UTC


README

Magento 2 支持自定义属性源模型,除了将其索引到 catalog_product_index_eav 表(该表为分层导航提供数据)。

原始问题出现在 \Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\Source:302,在该处确保保存的值存在于 eav_attribute_option 表中。当使用该自定义源模型时,这些值不存在。

第一个/简单解决方案是注释掉这些行。但这在生产环境中不可行,因此需要一个更持久的解决方案。虽然使用 preference 不是首选,但这将在短期内解决问题。

经过一番研究和花费很多时间后,我发现 @maderlock 有一个很好的修复方法:[magento/magento2#417 (评论)](https://github.com/magento/magento2/issues/417#issuecomment-265146285)

以下是运行此程序的步骤

  • composer require swiftotter/attribute-index-fix
  • php bin/magento module:enable SwiftOtter_AttributeIndexFix
  • php bin/magento cache:clean