Fatal error in query.php line 28
-
Yesterday I was updating a couple of plugins on a wordpress 4.2.2 website I just inherited when suddenly both in the front end and the admin area I received this error:
Fatal error: Call to a member function get() on a non-object in /home/accountName/public_html/wp-includes/query.php on line 28
I immediately started researching what could have happened. I inherited the site about a week ago and I have been updating the various plugins that are installed without much trouble. At the time of the error, I was trying to update the Yoast SEO plugin and it seemed to be taking more time than usual.
After conducting some research on the error online I tried to fix the site as suggested but nothing seemed to work. Finally I opened the file
query.php
and I simply commented pout this line:
return $wp_query->get( $var, $default );
Magically, the site returned to working conditions and it has been working since.
However, I am not really sure why and I suppose that line of code is needed for wordpress to work properly.
I do have a backup (both files and database_) from a few days ago and the only change I really made was in one of the page.
Also, the backup plugin installed in the site apparently would let me restore just the plugin directory if I wanted to (it seems to allow partial restores and in fact I wasn’t able to find a complete backup).
I’d like to know how to proceed. Should I restore the plugin directory since it looked like the culprit for the error?
SHould I try to restore the entire site even though that backup plugin seem to be a bit disjointed?I’d really appreciate some help from somebody with a bit more experience on the matter. Thank you.
- The topic ‘Fatal error in query.php line 28’ is closed to new replies.