-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.3.2 Upgrade Undefined factory elasticsuite #1445
Comments
Looks like you have to do something similar to magento/magento2@885b7a9#diff-b2e0d454e4ffd542fa96dc1b7dc225d9 this now, though I haven't gotten that to work personally |
worked for me after dealing with the broken addisinstockfilter plugin: in elasticsuitecatalog\etc\di.xml add : <virtualType name="elasticsearchLayerCategoryItemCollectionProvider" type="Magento\Elasticsearch\Model\Layer\Category\ItemCollectionProvider">
<arguments>
<argument name="factories" xsi:type="array">
<item name="elasticsuite" xsi:type="object">Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\CollectionFactory</item>
</argument>
</arguments>
</virtualType>
<type name="Magento\CatalogSearch\Model\Search\ItemCollectionProvider">
<arguments>
<argument name="factories" xsi:type="array">
<item name="elasticsuite" xsi:type="object">elasticsearchAdvancedCollectionFactory</item>
</argument>
</arguments>
</type>
<type name="Magento\CatalogSearch\Model\Advanced\ProductCollectionPrepareStrategyProvider">
<arguments>
<argument name="strategies" xsi:type="array">
<item name="elasticsuite" xsi:type="object">Magento\Elasticsearch\Model\Advanced\ProductCollectionPrepareStrategy</item>
</argument>
</arguments>
</type>
<virtualType name="elasticsearchLayerSearchItemCollectionProvider" type="Magento\Elasticsearch\Model\Layer\Search\ItemCollectionProvider">
<arguments>
<argument name="factories" xsi:type="array">
<item name="elasticsuite" xsi:type="object">Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\CollectionFactory</item>
</argument>
</arguments>
</virtualType> |
Also you could put back the module-catalog-inventory/Model/Plugin/Layer.php instead of deleting this plugin in elasticsearch: <?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\CatalogInventory\Model\Plugin;
class Layer
{
/**
* Stock status instance
*
* @var \Magento\CatalogInventory\Helper\Stock
*/
protected $stockHelper;
/**
* Store config instance
*
* @var \Magento\Framework\App\Config\ScopeConfigInterface
*/
protected $scopeConfig;
/**
* @param \Magento\CatalogInventory\Helper\Stock $stockHelper
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
*/
public function __construct(
\Magento\CatalogInventory\Helper\Stock $stockHelper,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
$this->stockHelper = $stockHelper;
$this->scopeConfig = $scopeConfig;
}
/**
* Before prepare product collection handler
*
* @param \Magento\Catalog\Model\Layer $subject
* @param \Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection $collection
*
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforePrepareProductCollection(
\Magento\Catalog\Model\Layer $subject,
\Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection $collection
) {
if ($this->_isEnabledShowOutOfStock()) {
return;
}
$this->stockHelper->addIsInStockFilterToCollection($collection);
}
/**
* Get config value for 'display out of stock' option
*
* @return bool
*/
protected function _isEnabledShowOutOfStock()
{
return $this->scopeConfig->isSetFlag(
'cataloginventory/options/show_out_of_stock',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
} |
Thank you, for that post. That saved my day. Mind the first tag and remove the ">" after virtualType |
Hello people, we are working on this one and aim to release an ElasticSuite 2.8.1 version as soon as possible :) @androshchuk will have a look on this one. I'm not sure "just" adding the factories will work properly. Maybe we'll also have to implement them, I'm not sure since I did not dig more into this. |
This one is fixed issue for me. https://github.com/comwrap/elasticsuite-magento-patch Hope will help somebody. If there are any problems please report or you can also push PR there |
Fixed by PR #1461 |
After removing or fixing the plugin in this issue: #1442 when trying to use the search it throws a exception with
Undefined factory elasticsuite
being thrown in this file: https://github.com/magento/magento2/blob/9fc254f241b5a2fa9e28ebdbb179538ca7c1959f/app/code/Magento/Elasticsearch/Model/Layer/Search/ItemCollectionProvider.php#L46Preconditions
Magento Version : 2.3.2
ElasticSuite Version : 2.8.0
Environment : Developer
Third party modules : N/A
Steps to reproduce
Expected result
Actual result
From checking it seems this file is newly added in 2.3.2
The text was updated successfully, but these errors were encountered: