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

principia

Well-known member
#1
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?
 

principia

Well-known member
#3
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
 

Mike

XenForo developer
Staff member
#5
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);
            }
]
 

principia

Well-known member
#7
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) {
}
}
 
Top