When I run setup:di:compile command in M2, I got this error in one of my modules.
Extra parameters passed to parent construct: $context
File name : edit.php
Location : /app/code/Vendor/Module/Controller/Adminhtml/Attachment/Edit.php
<?php
namespace Vendor\Module\Controller\Adminhtml\Attachment;
use Magento\Framework\Controller\Result\JsonFactory;
class Edit extends \Vendor\Module\Controller\Adminhtml\Attachment{
protected $_resultPageFactory;
protected $_resultJsonFactory;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
JsonFactory $resultJsonFactory,
\Vendor\Module\Model\AttachmentFactory $attachmentFactory,
\Magento\Framework\Registry $registry
)
{
$this->_resultPageFactory = $resultPageFactory;
$this->_resultJsonFactory = $resultJsonFactory;
parent::__construct($context, $resultPageFactory, $resultJsonFactory, $attachmentFactory, $registry);
}
Which params are extra in this code ?
Please help. My other modules are not installing due to this error.