swiftotter / attribute-index-fix
N/A
v2.2
2018-02-06 17:15 UTC
Requires
- php: ~7.0.0
- lib-libxml: *
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