0

I am getting

Call to a member function dispatch() on null in C:\xampp\htdocs\magento2x_6\lib\internal\Magento\Framework\App\Action\Action.php on line 91

How to debug the error? i wont get any logs!!

Doesnt enter the execute() of the controller

my etc/module

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="2.2.0">
    <sequence>
        <module name="Magento_Catalog"/>
        <module name="Magento_CatalogSearch"/>
        <module name="Vendor_Module2"/>
    </sequence>
</module>

etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
    <route id="merchandisingpage" frontName="merchandisingpage">
        <module name="Vendor_Module"/>
    </route>
</router>

Controller/Result/Index

namespace Vendor\Module\Controller\Result;

class Index extends \Magento\Framework\App\Action\Action
{

    protected $tglssearchClientConnector;

public function __construct( 
    // \Magento\Framework\App\Action\Context $context,
    \Magento\Catalog\Model\Session $catalogSession,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    /*\Magento\Search\Model\QueryFactory $queryFactory,
    \Magento\Catalog\Model\Layer\Resolver $layerResolver, */
    \Magento\Framework\App\Request\Http $request,
    \Magento\Framework\View\LayoutInterface $layout,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Vendor_Module3\Model\Client\Connector $tglssearchClientConnector,
    \Magento\Catalog\Model\CategoryFactory $catalogCategoryFactory,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory 
)
{
    $this->request = $request;
    $this->layout = $layout;
    $this->scopeConfig = $scopeConfig;
    $this->catalogSession = $catalogSession;
    $this->storeManager = $storeManager;
    $this->tglssearchClientConnector = $tglssearchClientConnector;
    $this->catalogCategoryFactory = $catalogCategoryFactory;
    $this->registry = $registry;
    $this->resultPageFactory=$resultPageFactory;
}
1

please uncomment below line in your constructor call

// \Magento\Framework\App\Action\Context $context,

and add below parent constructor call in your constructor function

parent::__construct($context);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.