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

Fixed error message every hour (deleted forums with expiring redirects)

Discussion in 'Resolved Bug Reports' started by principia, Nov 23, 2011.

  1. principia

    principia Well-Known Member

    since some weeks ago i got this error in the error log:

    #0 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(386): XenForo_Application::handlePhpError(false)
    #1 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(395): XenForo_DataWriter_Discussion_Thread::setForumCacheItem(51)
    #2 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(380): XenForo_DataWriter_Discussion_Thread::getForumCacheItem()
    #3 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(301): XenForo_DataWriter_Discussion_Thread->_getForumData()
    #4 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(283): XenForo_DataWriter_Discussion_Thread->_forumCountsMessages(Array, true)
    #5 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion.php(687): XenForo_DataWriter_Discussion_Thread->_updateUserMessageCount()
    #6 /home/www/web197/html/forum/library/XenForo/DataWriter.php(1736): XenForo_DataWriter_Discussion->_postDelete()
    #7 /home/www/web197/html/forum/library/XenForo/Model/ThreadRedirect.php(161): XenForo_DataWriter->delete(Array)
    #8 /home/www/web197/html/forum/library/XenForo/CronEntry/CleanUp.php(37): XenForo_Model_ThreadRedirect->deleteThreadRedirects(Array)
    #9 /home/www/web197/html/forum/library/XenForo/Model/Cron.php(356): XenForo_CronEntry_CleanUp::runHourlyCleanUp(Array, Array)
    #10 /home/www/web197/html/forum/library/XenForo/Cron.php(29): XenForo_Model_Cron->runEntry(Array)
    #11 /home/www/web197/html/forum/library/XenForo/Cron.php(64): XenForo_Cron->run()
    #12 /home/www/web197/html/forum/cron.php(12): XenForo_Cron::runAndOutput()
    #13 {main}
    Benötigter Status
    array(3) {
    ["url"] => string(44) "http://www.xxxxxxxxxx.de/cron.php?1317089255"
    ["_GET"] => array(1) {
    [1317089255] => string(0) ""
    }
    ["_POST"] => array(0) {
    }
    }


    this comes every hour and the error log filled up.(on 1.0 and 1.1)
    its not a big deal, because the forum runs fine without any problems.
    but deleting this errors every day isnt a solution.

    any tips for me to find the error?
     
  2. Mike

    Mike XenForo Developer Staff Member

    You've cut off the actual error message. It should be at the top.
     
  3. principia

    principia Well-Known Member

    this?

    ErrorException: Argument 1 passed to XenForo_DataWriter_Discussion_Thread::setForumCacheItem() must be an array, boolean given, called in /home/www/webXXX/html/forum/library/XenForo/DataWriter/Discussion/Thread.php on line 395 and defined - library/XenForo/DataWriter/Discussion/Thread.php:386
     
  4. Mike

    Mike XenForo Developer Staff Member

    That'd be it. Moving this to bugs for analysis.
     
  5. Mike

    Mike XenForo Developer Staff Member

    Looks like that'll happen if it tries to expire a thread redirect in a forum that was removed.

    In library/XenForo/DataWriter/Discussion/Thread.php, change:
    Code:
                self::setForumCacheItem(XenForo_Model::create('XenForo_Model_Forum')->getForumById($forumId));
    to:
    Code:
                $forum = XenForo_Model::create('XenForo_Model_Forum')->getForumById($forumId);
                if (!$forum)
                {
                    self::$forumCache[$forumId] = false;
                }
                else
                {
                    self::setForumCacheItem($forum);
                }
    ]
     
    Floris likes this.
  6. principia

    principia Well-Known Member

    i have changed the code. will give you an answer in a hour or two
    thanks for the help
     
    Floris likes this.
  7. principia

    principia Well-Known Member

    Hmm, that does not work for me :(

    ErrorException: Undefined index: node_id - library/XenForo/DataWriter/Discussion/Thread.php:388
    Erstellt von: Unbekanntes Benutzerkonto, Vor 3 Minuten
    Stapelverfolgung
    #0 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(388): XenForo_Application::handlePhpError(Array)
    #1 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(400): XenForo_DataWriter_Discussion_Thread::setForumCacheItem(51)
    #2 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(380): XenForo_DataWriter_Discussion_Thread::getForumCacheItem()
    #3 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(301): XenForo_DataWriter_Discussion_Thread->_getForumData()
    #4 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion/Thread.php(283): XenForo_DataWriter_Discussion_Thread->_forumCountsMessages(Array, true)
    #5 /home/www/web197/html/forum/library/XenForo/DataWriter/Discussion.php(687): XenForo_DataWriter_Discussion_Thread->_updateUserMessageCount()
    #6 /home/www/web197/html/forum/library/XenForo/DataWriter.php(1738): XenForo_DataWriter_Discussion->_postDelete()
    #7 /home/www/web197/html/forum/library/XenForo/Model/ThreadRedirect.php(161): XenForo_DataWriter->delete(Array)
    #8 /home/www/web197/html/forum/library/XenForo/CronEntry/CleanUp.php(37): XenForo_Model_ThreadRedirect->deleteThreadRedirects(Array)
    #9 /home/www/web197/html/forum/library/XenForo/Model/Cron.php(356): XenForo_CronEntry_CleanUp::runHourlyCleanUp(Array, Array)
    #10 /home/www/web197/html/forum/library/XenForo/Cron.php(29): XenForo_Model_Cron->runEntry(Array)
    #11 /home/www/web197/html/forum/library/XenForo/Cron.php(64): XenForo_Cron->run()
    #12 /home/www/web197/html/forum/cron.php(12): XenForo_Cron::runAndOutput()
    #13 {main}
    Benötigter Status
    array(3) {
    ["url"] => string(44) "http://www.xxxxx.de/cron.php?1322169081"
    ["_GET"] => array(1) {
    [1322169081] => string(0) ""
    }
    ["_POST"] => array(0) {
    }
    }
     
  8. Mike

    Mike XenForo Developer Staff Member

    Oops... don't like this code :)
     
  9. Mike

    Mike XenForo Developer Staff Member

    I've updated the replacement code above. That should sort it.
     
  10. principia

    principia Well-Known Member

    That fixed it, thank you.
     

Share This Page