1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed ErrorException: Argument 1 passed to XenForo_Model_User::canWarnUser() must be of the type array, nu

Discussion in 'Resolved Bug Reports' started by Carla Birch, Feb 1, 2014.

  1. Carla Birch

    Carla Birch Well-Known Member

    Hi,

    I'm testing the 1.3 beta on my local test install and it installs fine, but once i login the front end i get white page with An unexpected error occurred. Please try again later.

    Checking the admin error log i get the following errors:

    PHP:
    ErrorExceptionArgument 1 passed to XenForo_Model_User::canWarnUser() must be of the type array, null givencalled in /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ReportHandler/User.php on line 49 and defined library/XenForo/Model/User.php:2178
    Generated By
    C.Birch1 min ago
    Stack Trace

    #0 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/Model/User.php(2178): XenForo_Application::handlePhpError(4096, 'Argument 1 pass...', '/Applications/X...', 2178, Array)
    #1 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ReportHandler/User.php(49): XenForo_Model_User->canWarnUser(NULL, NULL, Array)
    #2 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/Model/Report.php(184): XenForo_ReportHandler_User->getVisibleReportsForUser(Array, Array)
    #3 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/Model/Report.php(273): XenForo_Model_Report->getVisibleReportsForUser(Array, Array)
    #4 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ControllerPublic/Abstract.php(389): XenForo_Model_Report->getActiveReportsCountsForUser()
    #5 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ControllerPublic/Abstract.php(357): XenForo_ControllerPublic_Abstract->_updateModeratorSessionReportCounts()
    #6 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ControllerPublic/Abstract.php(30): XenForo_ControllerPublic_Abstract->_updateModeratorSessionCaches()
    #7 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/Controller.php(308): XenForo_ControllerPublic_Abstract->_preDispatchType('Index')
    #8 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Index', 'XenForo_Control...')
    #9 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #10 /Applications/XAMPP/xamppfiles/htdocs/forums/index.php(13): XenForo_FrontController->run()
    #11 {main}

    Request State

    array(3) {
      [
    "url"] => string(24"http://localhost/forums/"
      
    ["_GET"] => array(0) {
      }
      [
    "_POST"] => array(0) {
      }
    }
    PHP:
    ErrorExceptionUndefined indexuser library/XenForo/ReportHandler/User.php:49
    Generated By
    C.Birch2 min ago
    Stack Trace

    #0 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ReportHandler/User.php(49): XenForo_Application::handlePhpError(8, 'Undefined index...', '/Applications/X...', 49, Array)
    #1 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/Model/Report.php(184): XenForo_ReportHandler_User->getVisibleReportsForUser(Array, Array)
    #2 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/Model/Report.php(273): XenForo_Model_Report->getVisibleReportsForUser(Array, Array)
    #3 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ControllerPublic/Abstract.php(389): XenForo_Model_Report->getActiveReportsCountsForUser()
    #4 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ControllerPublic/Abstract.php(357): XenForo_ControllerPublic_Abstract->_updateModeratorSessionReportCounts()
    #5 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/ControllerPublic/Abstract.php(30): XenForo_ControllerPublic_Abstract->_updateModeratorSessionCaches()
    #6 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/Controller.php(308): XenForo_ControllerPublic_Abstract->_preDispatchType('Errorserver')
    #7 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Errorserver', 'XenForo_Control...')
    #8 /Applications/XAMPP/xamppfiles/htdocs/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #9 /Applications/XAMPP/xamppfiles/htdocs/forums/index.php(13): XenForo_FrontController->run()
    #10 {main}

    Request State

    array(3) {
      [
    "url"] => string(24"http://localhost/forums/"
      
    ["_GET"] => array(0) {
      }
      [
    "_POST"] => array(0) {
      }
    }
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Do you still get these errors even with all add ons disabled?
     
  3. Carla Birch

    Carla Birch Well-Known Member

    Yep all add-on disabled, even got $config['enableListeners'] = false; in config
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Moved to bugs.
     
  5. Mike

    Mike XenForo Developer Staff Member

    Is this a fresh install or an upgrade? If it's an upgrade, did you have any add-ons installed before? (Particularly one that allowed users to be reported.)
     
  6. Carla Birch

    Carla Birch Well-Known Member

  7. Carla Birch

    Carla Birch Well-Known Member

    Other add-on's that might deal with reports are
    • [NFLJ] Showcase
    • XFA - Better Blogs
    • XenZine Articles
    • sonnb - XenGallery
     
  8. Moshe1010

    Moshe1010 Well-Known Member

    I have:
    Conversation Essentials and sonnb - XenGallery, and my 1.3 upgrade went fine.
     
  9. Mike

    Mike XenForo Developer Staff Member

    Did you ever have an add-on that allowed users to be reported? It certainly looks like that's what's causing this. The code just needs to be more resilient I think.
     
  10. Carla Birch

    Carla Birch Well-Known Member

    @Mike i have taken a look at the datebase and have removed two user reports from the table and now its working, not sure what add-on made the reports.

    Screen Shot 2014-02-01 at 11.52.26.png
     
  11. Mike

    Mike XenForo Developer Staff Member

    That must be from an add-on, as it appears that was reported in November. (Reporting a user is new in 1.3.)
     
  12. Carla Birch

    Carla Birch Well-Known Member

    Yep it's from a add-on, 1 i no longer seem to have installed because the reports no longer in the closed reports, trying to find out what add-on it was from so it can help others who might get same problem.
     
  13. Mike

    Mike XenForo Developer Staff Member

    I've made the code handle this a bit better, though note that entries made with the add-on are effectively "corrupt" in terms of our code, so they won't function as expected.
     
    Carla Birch and Dan like this.

Share This Page