I'm working on a Magento module for the past month, and everything works great on my local machine. Then I decided to release the module as a beta and test it online in a newly installed store, and after installing it from CLI, I'm getting this error:
Werules\Chatbot\Block\Webhook\Messenger Missed required argument request in parent::__construct call. File: /htdocs/magento2/app/code/Werules/Chatbot/Block/Webhook/Messenger.php
Why is that happening? Here is the file app/code/Werules/Chatbot/Block/Webhook/Messenger.php
namespace Werules\Chatbot\Block\Webhook;
class Messenger extends \Werules\Chatbot\Block\Webhook\Index
{
protected function processRequest()
{
// SOME CODE HERE
}
}
and app/code/Werules/Chatbot/Block/Webhook/Index.php
namespace Werules\Chatbot\Block\Webhook;
class Index extends \Magento\Framework\View\Element\Template
{
protected $_helper;
protected $_chatbotAPI;
protected $_messageModel;
protected $_objectManager;
protected $_define;
protected $_request;
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\ObjectManagerInterface $objectManager,
\Werules\Chatbot\Helper\Data $helperData,
\Werules\Chatbot\Model\ChatbotAPI $chatbotAPI,
\Magento\Framework\App\Request\Http $request,
\Werules\Chatbot\Model\MessageFactory $message
)
{
$this->_helper = $helperData;
$this->_chatbotAPI = $chatbotAPI;
$this->_request = $request;
$this->_messageModel = $message;
$this->_objectManager = $objectManager;
$this->_define = new \Werules\Chatbot\Helper\Define;
parent::__construct($context);
}
}
What I am doing wrong? Thank you.
EDIT: I'm extending another block from my module, is that a bad thing? Maybe this is the problem?
var/generation
first?