XF 2.1 [E_NOTICE] Trying to get property 'is_discouraged' of non-object src/XF/Pub/Controller/AbstractController.php:365

sajal

Active member
When the user logs in and redirected to home page, why I get the following error in the Server error log. In frontend, I can see " An error occurred while the page was being generated. Please try again later.".

Any help would be greatly appreciated:
  • [E_NOTICE] Trying to get property 'is_discouraged' of non-object

  • src/XF/Pub/Controller/AbstractController.php:365

    Stack:
    #0 src/XF/Pub/Controller/AbstractController.php(365): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/sajal/web...', 365, Array)
    #1 src/XF/Pub/Controller/AbstractController.php(25): XF\Pub\Controller\AbstractController->isDiscouraged()
    #2 src/XF/Mvc/Controller.php(123): XF\Pub\Controller\AbstractController->preDispatchType('DispatchError', Object(XF\Mvc\ParameterBag))
    #3 src/XF/Mvc/Dispatcher.php(320): XF\Mvc\Controller->preDispatch('DispatchError', Object(XF\Mvc\ParameterBag))
    #4 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Error', 'DispatchError', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Error), NULL)
    #5 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Error), NULL)
    #6 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
    #7 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
    #8 src/XF.php(390): XF\App->run()
    #9 index.php(22): XF::runApp('XF\\Pub\\App')
    #10 {main}
 
This would imply \XF::visitor() is not returning a user entity, which should always be the case.
 
Back
Top Bottom