Open MurKit opened 7 years ago
I get the exact same error
Yes I am also facing the same issues http://prntscr.com/g3ubke
Hello You need to below changes into files.
1) Incorrect dependency in class Mageplaza\HelloWorld\Controller\Adminhtml\Post in /var/www/mage2/app/code/Mageplaza/HelloWorld/Controller/Adminhtml/Post.php \Magento\Backend\Model\View\Result\RedirectFactory already exists in context object
Reply : $this->redirectFactory = $context->getRedirectFactory();
comment below code : //\Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory,
use below code :+1: public function __construct( \Mageplaza\HelloWorld\Model\Upload $uploadModel, \Mageplaza\HelloWorld\Model\Post\File $fileModel, \Mageplaza\HelloWorld\Model\Post\Image $imageModel, //\Magento\Backend\Model\Session $backendSession, \Mageplaza\HelloWorld\Model\PostFactory $postFactory, \Magento\Framework\Registry $registry, //\Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory, /// \Magento\Backend\Model\View\Result\RedirectFactory $redirectFactory , \Magento\Backend\App\Action\Context $context //Phpexcel_PHPExcel $xlsx //\PHPExcel\IOFactory $iOFactory; //Phpexcel_PHPExcel $xlsx
)
{
$this->_uploadModel = $uploadModel;
$this->_fileModel = $fileModel;
$this->_imageModel = $imageModel;
// $this->_backendSession = $backendSession;
$this->redirectFactory = $context->getRedirectFactory();
//$this->_iOFactory = $iOFactory;
//$this->excelFactory = $excelFactory;
//$this->excelFactory = $excelFactory;
parent::__construct($postFactory, $registry,$context);
}
Hello ,
1) Incorrect dependency in class Mageplaza\HelloWorld\Controller\Adminhtml\Post\Save in /var/www/mage2/app/code/Mageplaza/HelloWorld/Controller/Adminhtml/Post/Save.php \Magento\Backend\Model\Session already exists in context object \Magento\Backend\Model\View\Result\RedirectFactory already exists in context object Mageplaza\HelloWorld\Controller\Adminhtml\Post\Edit
Reply : use below code :+1: public function __construct( // \Magento\Backend\Model\Session $backendSession, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, \Mageplaza\HelloWorld\Model\PostFactory $postFactory, \Magento\Framework\Registry $registry, //\Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory, \Magento\Backend\App\Action\Context $context ) { //$this->_backendSession = $backendSession; $this->_resultPageFactory = $resultPageFactory; $this->_resultJsonFactory = $resultJsonFactory; $this->redirectFactory = $context->getRedirectFactory(); parent::__construct($postFactory,$registry,$context); }
I'm on Magento CE 2.1.7.
After I download this extension and copy it to my Magento installation I run some cli commands.
sudo rm -rf var/di/ sudo rm -rf var/cache/ sudo rm -rf var/generation/ sudo rm -rf var/page_cache/
sudo chmod -R 777 pub/ sudo chmod -R 777 var/
php -f bin/magento cache:clean php bin/magento setup:upgrade php bin/magento setup:di:compile
And on the last step there are errors: