Magento – Call to a member function setActive() on boolean

magento-2.1magento2

I encountered the following issue when i was trying to install a module. When I try to access the admin panel on my magento I get:

Call to a member function setActive() on boolean in C:\xampp\htdocs\project\vendor\magento\module-backend\Model\View\Result\Page.php on line 27

I disabled all third party and custom modules, I compiled the code but I still get this error.

EDIT: I did a var_dump($itemId) just below the line where the error is and the $itemid is 'Magento_Backend::dashboard'.

EDIT 2: The error is because the line "$this->layout->getBlock('menu');" above returns false. I can't find though why this is happening

Best Answer

I will try this to solve problem if setActive() error() arrived after setup:di:compile then becauese of session is destroy.

So go to Magento directory and then delete file generated by di:compile is path :-

magento\generated\metadata\global.php delete this file then after refersh your page.

This is temporary solution for this error in local server.

Related Topic