Closed lewisje closed 5 years ago
I can second this. It also breaks the auto suggest search box.
I'm also getting this on the Categories page in admin. Edit: this seems to be caused by \Magento\Framework\App\Config\ScopeCodeResolver::resolve, which used to set $resolverScopeCode = $scopeCode, but since this https://github.com/magento/magento2/commit/d79cfa9009034d8df1a37587ecbed2d62225d3d6?diff=split it doesn't anymore.
And ... another BC change on a minor version... great ...
Thank you for reporting it quickly, we gonna release a minor version to handle this change asap.
@mropanen I think you pointed the correct file. We'll have a look.
Thank you guys ! We keep you in touch
It appears that the code is only in 2.2 for now and has not been forward-ported to 2.3 (which is very bad ..).
Anyway, we should fix it on both Elasticsuite 2.6 and 2.7.
Hi,
here is a workaround with around plugin for temporary fix error `Invalid scope type 'containers_stores'' with Magento 2.2.8 C.E
<?php
namespace [Vendor]\[Module]\Plugin\Framework\App\Config;
use InvalidArgumentException;
use Magento\Framework\App\Config\ScopeCodeResolver as ConfigScopeCodeResolver;
use Magento\Framework\App\ScopeResolverPool;
use Magento\Store\Model\StoreManagerInterface;
use Psr\Log\LoggerInterface;
/**
* Class ScopeCodeResolver
* @package [Vendor]\[Module]\Plugin\Framework\App\Config
*/
class ScopeCodeResolver
{
/**
* @var StoreManagerInterface
*/
private $storeManager;
/**
* @var ScopeResolverPool
*/
private $scopeResolverPool;
/**
* @var []
*/
private $resolvedScopeCodes;
/**
* @var LoggerInterface
*/
private $logger;
/**
* ScopeCodeResolver constructor.
* @param StoreManagerInterface $storeManager
* @param LoggerInterface $logger
*/
public function __construct(
ScopeResolverPool $scopeResolverPool,
StoreManagerInterface $storeManager,
LoggerInterface $logger
) {
$this->scopeResolverPool = $scopeResolverPool;
$this->storeManager = $storeManager;
$this->logger = $logger;
}
public function aroundResolve(
ConfigScopeCodeResolver $scopeCodeResolver,
callable $proceed,
$scopeType,
$scopeCode
) {
try {
return $proceed($scopeType, $scopeCode);
} catch (InvalidArgumentException $e) {
$this->logger->error($e->getMessage());
}
if (!isset($this->resolvedScopeCodes[$scopeType][$scopeCode])) {
$this->resolvedScopeCodes[$scopeType][$scopeCode] = $scopeCode;
}
return $this->resolvedScopeCodes[$scopeType][$scopeCode];
}
}
Hi @KEVWISNIEW,
I updated your comment to fix the code block rendering, but I didn't reviewed it. A minor release of ElasticSuite will be published today with our fix (#1362)
Regards,
For future reference :
the di.xml used for the plugin
`<?xml version="1.0"?>
`
When I go to a category page or use the site search, I get the error
Invalid scope type 'containers_stores'
; this does not happen on the home page or on a product page, or in the admin area.Preconditions
Magento Version : CE 2.2.8
ElasticSuite Version : 2.6.7
Environment : Developer (I first noticed this in the Production site, leading me to temporarily disable the module.)
Third party modules :
Steps to reproduce
Expected result
Actual result
This error did not happen under Magento 2.2.7 with this version of ElasticSuite, and it does not happen if ElasticSuite is disabled; I tried installing ElasticSuite 2.7.x in case that might help (even though officially it is for Magento 2.3.x only), but it requires a higher version of PHP than my system has, so that would need to wait for later.
I also noticed that another Magento module ended up giving up on its own custom scope type when a similar error was reported.
In case it helps, this is the full changeset between 2.2.7 and 2.2.8, most notably including a new
ToolbarMemorizer
class; also, I am using this workaround to get the search bar to show up in the Ultimo theme.