I'm using Magento 2.3.3.
I created a plugin that can edit product at the frontend. The plugin works fine. But it error when running setup:di:compile.
Incompatible argument type: Required type: \Magento\Framework\Escaper. Actual type: array; File:.../app/code/.../xxx.php
Here is my code,
class Edit extends \Magento\Catalog\Block\Adminhtml\Product\Edit
{
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
\Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory,
\Magento\Framework\Registry $registry,
\Magento\Catalog\Helper\Product $productHelper,
array $data = []
) {
$this->_productHelper = $productHelper;
$this->_attributeSetFactory = $attributeSetFactory;
$this->_coreRegistry = $registry;
$this->jsonEncoder = $jsonEncoder;
parent::__construct($context,
$jsonEncoder,$attributeSetFactory,$registry,$productHelper,$data);
$this->setData('area','adminhtml');
}
protected function _construct()
{
parent::_construct();
$this->setId('product_edit');
$this->setUseContainer(true);
}
public function getProduct()
{
...................
Please help. Thank you