I have installed Magento 2.2.2.
Running php bin/magento setup:di:compile
result in this error:
Magento\Backend\Model\View\Layout\GeneratorPool
Incompatible argument type: Required type: \Magento\Framework\View\Layout\Condition\ConditionFactory.php
Actual type: \Magento\Framework\App\Config\ScopeConfigInterface; File:
vendor/magento/module-backend/Model/View/Layout/GeneratorPool.php
In
vendor/magento/framework/View/Layout/Condition/ConditionFactory.php:
<?php
namespace Magento\Framework\View\Layout\Condition;
use Magento\Framework\ObjectManagerInterface;
/**
* Factory for composite.
*/
class ConditionFactory
{
/**
* @var ObjectManagerInterface
*/
private $objectManager;
/**
* @param ObjectManagerInterface $objectManager
*/
public function __construct(ObjectManagerInterface $objectManager)
{
$this->objectManager = $objectManager;
}
/**
* @param array $elementVisibilityConditions
*
* @return Condition
*/
public function create(array $elementVisibilityConditions)
{
$conditions = [];
foreach ($elementVisibilityConditions as $condition) {
$conditions[] = $this->objectManager->create($condition['name']);
}
return $this->objectManager->create(Condition::class, ['conditions' => $conditions]);
}
}
In
vendor/magento/module-backend/Model/View/Layout/GeneratorPool.php:
<?php
namespace Magento\Backend\Model\View\Layout;
use Magento\Framework\View\Layout\ScheduledStructure;
use Magento\Framework\View\Layout\Data\Structure;
/**
* Pool of generators for structural elements
*/
class GeneratorPool extends \Magento\Framework\View\Layout\GeneratorPool
{
/**
* @var Filter\Acl
*/
protected $aclFilter;
/**
* @param ScheduledStructure\Helper $helper
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver
* @param \Psr\Log\LoggerInterface $logger
* @param Filter\Acl $aclFilter
* @param array $generators
*/
public function __construct(
ScheduledStructure\Helper $helper,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Framework\App\ScopeResolverInterface $scopeResolver,
\Psr\Log\LoggerInterface $logger,
Filter\Acl $aclFilter,
array $generators = null
) {
$this->aclFilter = $aclFilter;
parent::__construct(
$helper,
$scopeConfig,
$scopeResolver,
$logger,
$generators
);
}
/**
* Build structure that is based on scheduled structure
*
* @param ScheduledStructure $scheduledStructure
* @param Structure $structure
* @return $this
*/
protected function buildStructure(ScheduledStructure $scheduledStructure, Structure $structure)
{
parent::buildStructure($scheduledStructure, $structure);
$this->aclFilter->filterAclElements($scheduledStructure, $structure);
return $this;
}
}
What is the fix?
php bin/magento setup:di:compile