Closed jasperzeinstra closed 5 years ago
@Fgruntjes could you look into this? We have multiple clients with the same issue.
Confirmed, we also see this problem after upgrading to Magento 2.2.5 (from 2.2.2).
Dirty and ugly fix (not very well tested):
--- a/src/Model/Write/Products/CollectionDecorator/CategoryReference.php
+++ b/src/Model/Write/Products/CollectionDecorator/CategoryReference.php
@@ -18,7 +18,7 @@ class CategoryReference extends AbstractDecorator
{
$query = $this->getConnection()
->select()
- ->from($this->getTableName(AbstractAction::MAIN_INDEX_TABLE), ['category_id', 'product_id'])
+ ->from($this->getTableName(AbstractAction::MAIN_INDEX_TABLE . '_store' . $collection->getStoreId()), ['category_id', 'product_id'])
->where('store_id = ?', $collection->getStoreId())
->where('product_id IN(' . implode(',', $collection->getIds()) . ')')
->query();
You can't add this like this to the module, since this module needs to support Magento < 2.2.5 & Magento >= 2.2.5, so a proper solution is probably to rewrite this select and use some kind of built-in function from Magento to get this data (if that exists).
@hostep we've already created a nice fix in the way Magento indented to get the table name based on a store, see: https://github.com/EmicoEcommerce/Magento2TweakwiseExport/pull/54
@jasperzeinstra: ah, I failed to look into the open PR's 😄 Looks much better then my hack.
Thanks for the heads up! 🙂
Update: left a comment behind in the PR, since it's not the correct solution if we want this module to be compatible with Magento 2.2.4 and lower.
This fix (a variant thereof) will soon be released, update will follow.
Fix for this issue has been released in 1.2.0
Tweakwise export isn't compatibale with Magento 2.2.5. They've changed the way the category products are indexed. More information can be found here: https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-index.html#config-cli-subcommands-index-reindex-parallel
In the database the table
catalog_category_product_index
isn't filled any more, instead they've created a table for each store (catalog_category_product_index_store1
,catalog_category_product_index_store2
,…
). Tweakwise export isn't expecting this and isn't finding any category product relation anymore. Resulting in empty categories.Environment
Steps to reproduce
master
branch.Actual result
Expected result