Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

After adding custom module on Server. It's giving below error

Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php:296 Stack trace: #0 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(975): Magento\Backend\Block\Menu->getCacheKeyInfo() #1 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(1027): Magento\Framework\View\Element\AbstractBlock->getCacheKey() #2 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(652): Magento\Framework\View\Element\AbstractBlock->_loadCache() #3 /var/www/html/magento/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml() #4 /var/www/html/magento/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('menu') #5 /var/www/html/magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('menu') #6 /var/www/html/magento/vendor/magento/framewo in /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php on line 296

 Fatal error: Uncaught Error: Call to a member function getId() on null
 in
 /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php:296
 Stack trace: #0
 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(975):
 Magento\Backend\Block\Menu->getCacheKeyInfo() #1
 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(1027):
 Magento\Framework\View\Element\AbstractBlock->getCacheKey() #2
 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(652):
 Magento\Framework\View\Element\AbstractBlock->_loadCache() #3
 /var/www/html/magento/vendor/magento/framework/View/Layout.php(542):
 Magento\Framework\View\Element\AbstractBlock->toHtml() #4
 /var/www/html/magento/vendor/magento/framework/View/Layout.php(518):
 Magento\Framework\View\Layout->_renderBlock('menu') #5
 /var/www/html/magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(206):
 Magento\Framework\View\Layout->renderNonCachedElement('menu') #6
 /var/www/html/magento/vendor/magento/framewo in
 /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php on
 line 296

It's displaying when Session Timeout from Admin

After adding custom module on Server. It's giving below error

Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php:296 Stack trace: #0 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(975): Magento\Backend\Block\Menu->getCacheKeyInfo() #1 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(1027): Magento\Framework\View\Element\AbstractBlock->getCacheKey() #2 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(652): Magento\Framework\View\Element\AbstractBlock->_loadCache() #3 /var/www/html/magento/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml() #4 /var/www/html/magento/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('menu') #5 /var/www/html/magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('menu') #6 /var/www/html/magento/vendor/magento/framewo in /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php on line 296

It's displaying when Session Timeout from Admin

After adding custom module on Server. It's giving below error

 Fatal error: Uncaught Error: Call to a member function getId() on null
 in
 /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php:296
 Stack trace: #0
 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(975):
 Magento\Backend\Block\Menu->getCacheKeyInfo() #1
 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(1027):
 Magento\Framework\View\Element\AbstractBlock->getCacheKey() #2
 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(652):
 Magento\Framework\View\Element\AbstractBlock->_loadCache() #3
 /var/www/html/magento/vendor/magento/framework/View/Layout.php(542):
 Magento\Framework\View\Element\AbstractBlock->toHtml() #4
 /var/www/html/magento/vendor/magento/framework/View/Layout.php(518):
 Magento\Framework\View\Layout->_renderBlock('menu') #5
 /var/www/html/magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(206):
 Magento\Framework\View\Layout->renderNonCachedElement('menu') #6
 /var/www/html/magento/vendor/magento/framewo in
 /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php on
 line 296

It's displaying when Session Timeout from Admin

Tweeted twitter.com/StackMagento/status/937095446207647749
Source Link
Jackson
  • 10k
  • 31
  • 131
  • 217

Magento 2: Fatal error: Uncaught Error: Call to a member function getId()

After adding custom module on Server. It's giving below error

Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php:296 Stack trace: #0 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(975): Magento\Backend\Block\Menu->getCacheKeyInfo() #1 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(1027): Magento\Framework\View\Element\AbstractBlock->getCacheKey() #2 /var/www/html/magento/vendor/magento/framework/View/Element/AbstractBlock.php(652): Magento\Framework\View\Element\AbstractBlock->_loadCache() #3 /var/www/html/magento/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml() #4 /var/www/html/magento/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('menu') #5 /var/www/html/magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('menu') #6 /var/www/html/magento/vendor/magento/framewo in /var/www/html/magento/vendor/magento/module-backend/Block/Menu.php on line 296

It's displaying when Session Timeout from Admin