Mobile Menu

Blog

How to fix “Fatal error: Call to a member function get() on a non-object”

May 29, 2012 by Bridget Wessel

After updating one of my sites, every page displayed the following error and the following error only:

Fatal error: Call to a member function get() on a non-object in [path to site]sitewp-includesquery.php on line 27

The site was for all intents and purposes broken and I couldn’t get anywhere. Not a great way to start the day.

I disabled all plugins in the database by deleting the option_value where option_name = ‘active_plugins’ in table wp_options. My site started working when all the plugins were disabled so I knew it was a plugin conflict. I then started enabling plugins to figure out the problem. I only get the error if both plugins “Reed Write” and “Event Manager” are enabled together. Both could be enabled separately without breaking the site but both are important plugins and I was not looking forward to converting their data to another plugin. So I looked for another alternative starting with the error – line 27 in wp-includes/query.php. The following is hacking WordPress core, but it got my site back up.

If you add this fix, take note so you can add the patch back in case query.php is overwritten with a WordPress update. Otherwise, your site should be back up and running.

8 comments on “How to fix “Fatal error: Call to a member function get() on a non-object””

Leave feedback

(required)

Unbox Interactive

Hire us. You’ll be glad you did.