cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught Error: Call to a member function setActive() on boolean in /public_html/vendor/magento/modu

Uncaught Error: Call to a member function setActive() on boolean in /public_html/vendor/magento/modu

I get the below message if I try to create any root or sub categories. I have installed no plugins, and made no configuration changes other than to add a test page. Any ideas?  Its magento 2.3.0 installed by my ISP by hand,

 

 

Fatal error: Uncaught Error: Call to a member function setActive() on boolean in /var/sites/xxx.store/public_html/vendor/magento/module-backend/Model/View/Result/Page.php:27 Stack trace: #0 /var/sites/j/xxx.store/public_html/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Catalog...') #1 /var/sites/j/xxx.store/public_html/vendor/magento/module-catalog/Controller/Adminhtml/Category/Add.php(72): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Catalog...') #2 /var/sites/j/xxx.store/public_html/generated/code/Magento/Catalog/Controller/Adminhtml/Category/Add/Interceptor.php(24): Magento\Catalog\Controller\Adminhtml\Category\Add->execute() #3 /var/sites/j/xxx.store/public_html/vendor/magento/framework/App/Action/Action.php(108): Magento\Catalog\Controller\Adminhtml\Category\Add\Interceptor->execute() #4 /var/sites/j/xxx.store/public_html/vendor/magento/module-backend/App/AbstractAction.php(23 in /var/sites/j/xxx.store/public_html/vendor/magento/module-backend/Model/View/Result/Page.php on line 27

 

 

 

xxxyyyzzz : this is just my code so I can find this post again (as if you search by your display name it finds no posts, and there is no list of your own posts, even under "my subscriptions")

4 REPLIES 4

Re: Uncaught Error: Call to a member function setActive() on boolean in /public_html/vendor/magento/

Hello @codename1 ,

 

I had the same situation in the development of own modules (I created/changed layout files for grid in adminhtml). Try to clean cache and switch to development mode:

php bin/magento deploy:mode:set developer
php bin/magento module:enable --all
php bin/magento cache:clean

 

I suppose some cached stuff is not cleaned on cache:clean & setup:di:compile in production mode. You can switch back to production mode back if error will gone in development mode.

 

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Uncaught Error: Call to a member function setActive() on boolean in /public_html/vendor/magento/

Hello @codename1,

 

The same issue on windows + wamp after installing the first extension. Removing "generated\metadata\global.php" file fixed it.

Re: Uncaught Error: Call to a member function setActive() on boolean in /public_html/vendor/magento/

Check file namespace.

Check Again,

Again

And Again.

Note:

- uppercase 

- lowercase

Smiley Happy

Re: Uncaught Error: Call to a member function setActive() on boolean in /public_html/vendor/magento/

Temporary Fix :
-> Remove "generated\metadata\global.php" and it will fix.

 

Permanent Fix :

The problem is that the layout xml of this controller path is not loading properly.

Check that the name and the namespace of the controller is matching with the layout file name. Take care of the case sensitivity.

For example:

  • custom_module_admin_customcontroller_action.xml
  • Check the namespace of the Controller Properly
    Custom\Module\Controller\Adminhtml\Customcontroller
     and not 
    Custom\Module\Controller\Adminhtml\CustomController


If my answer is useful, please Accept as Solution & give Kudos