function.reset Passed variable is not an array or object in query.php

I had this problem with WordPress 3.1 where this weird message would come up while trying to access a blog category:

Warning: reset() [function.reset]: Passed variable is not an array or object in wp-includes/query.php on line 2890

I haven’t researched deeply into what is causing the problem but it seems to be related with WPML 2.0.4 and WP 3.1. Essentially is looks like when you update to WP 3.1 you should also upgrade WPML because 2.0.4 is not compatible with 3.1. However when you try to update you’re stuck with having to buy a commercial version of WPML because the authors no longer support a free version, how convenient, right?

I ended up fixing this by following the advice on the forums to create a Page template instead of using the category template and it worked. So basically you need something like this in your template:


I can see on Google that a lot of folks are being affected by this as we speak so I decided to share this quick fix.

Thread about this issue on the support forums