I recently did 3 years of upgrades to 1.6.9 and one of the strange things that happened was sporadic problems with the stats module.
The symptoms were the same as in this thread: http://ellislab.com/forums/viewthread/154385/ ane the problem was coming when I was calling a plugin.
The problem seems to be that this line in the stats module:
$weblog_id = (USER_BLOG !== FALSE) ? UB_BLOG_ID : 0;Was returning 0 and as the exp_stats table was empty it was failing further down. I’ve added a new record for all my existing weblog_ids and one for 0 and it works, but I suspect this is a bit of a bodge!
Is there another setting somewhere I need to change?